cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Leszek Gawron <o...@wlkp.org>
Subject JXPath usage problem
Date Mon, 22 Sep 2003 08:57:58 GMT

How can I map this functionality that uses JEXL (which works):
<t:forEach var="type" items="${typeList}">
	<t:choose>
		<t:when test="${pocket.Dev_DtId == type.Dt_DtId}">
			<option value="${type.Dt_DtId}" selected="">${type.Dt_Type}</option>
		</t:when>
		<t:otherwise>
			<option value="${type.Dt_DtId}">${type.Dt_Type}</option>
		</t:otherwise>
	</t:choose>
</t:forEach>

to JXPath ?

This does not work:
<select style="width: 147" name="Dev_DtId">
	<t:forEach select="#{typeList}">
		<t:choose>
			<t:when test="#{/pocket/Dev_DtId/text() = Dt_DtId/text()}">
				<option value="#{Dt_DtId}" selected="">#{Dt_Type}</option>
			</t:when>
			<t:otherwise>
				<option value="#{Dt_DtId}">#{Dt_Type}</option>
			</t:otherwise>
		</t:choose>
	</t:forEach>
</select>

my flow procedure is:
function addPocket( pocketId ) {
	var message="";
	var pocketDetails = {};
	
	var typeList = getTypesDb();
	var projectList = getProjectsDb();
	
	pocketDetails.Dev_Serial = "";
	pocketDetails.Dev_License = "";
	pocketDetails.Dev_InvoiceNo = "";
	pocketDetails.Dev_WzNo = "";
	pocketDetails.Dev_WzMtsNo = "";
	pocketDetails.Dev_Description = "";
	pocketDetails.Prj_PrjId = 0;
	pocketDetails.Dev_DtId = typeList[ 0 ];
	
	var first = true;
	while( true ) {
		if ( !first ) {
			typeList = getTypesDb();
			projectList = getProjectsDb();
			first = false;
		}
		if ( 	cocoon.request.getParameter( "submit-save" ) != null || 
				cocoon.request.getParameter( "submit-next" ) != null ) {
			pocketDetails.Dev_Serial = cocoon.request.getParameter( "Dev_Serial" );
			pocketDetails.Dev_License = cocoon.request.getParameter( "Dev_License" );
			pocketDetails.Dev_InvoiceNo = cocoon.request.getParameter( "Dev_InvoiceNo" );
			pocketDetails.Dev_WzNo = cocoon.request.getParameter( "Dev_WzNo" );
			pocketDetails.Dev_WzMtsNo = cocoon.request.getParameter( "Dev_WzMtsNo" );
			pocketDetails.Dev_Description = cocoon.request.getParameter( "Dev_Description" );
			pocketDetails.Prj_PrjId = cocoon.request.getParameter( "Prj_PrjId" );
			pocketDetails.Dev_DtId = cocoon.request.getParameter( "Dev_DtId" );
			
			//if ( validateProjectDetails( projectDetails ) ) {
			addPocketDb( pocketDetails );
			if ( cocoon.request.getParameter( "submit-next" ) != null ) {
				pocketDetails.Dev_Serial = "";
				pocketDetails.Dev_License = "";
				pocketDetails.Dev_Description = "";
			} else {
			cocoon.redirectTo( "/gemini-manager/service/pocket-list?project.chk=&project.input=0"
);
			}
		}
		if ( cocoon.request.getParameter( "submit-cancel" ) != null ) {
			cocoon.redirectTo( "/gemini-manager/service/pocket-list?project.chk=&project.input=0"
);
		}
		
		cocoon.sendPageAndWait( "view/pocket-add.jx", { typeList: typeList.rows, 
														projectList: projectList.rows, 
														pocket: pocketDetails, 
														message: message } );		
	}
}

-- 
            __
         | /  \ |        Leszek Gawron            //  \\
        \_\\  //_/       ouzo@wlkp.org           _\\()//_
         .'/()\'.     Phone: +48(501)720812     / //  \\ \
          \\  //  recursive: adj; see recursive  | \__/ |


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@cocoon.apache.org
For additional commands, e-mail: users-help@cocoon.apache.org


Mime
View raw message