<select style="width: 147" name="Dev_DtId">
<t:forEach select="#{typeList}">
<t:choose>
<t:when test="#{/pocket/Dev_DtId = Dt_DtId}">
<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>JXPath doesn't support the text() function on Bean nodes.
Leszek Gawron wrote:
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 } );
}
}
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
