jsf & jstl (t:datalist and c:when)

hi,

i have a problem with da t:datalist and some c:choose (c:when) conditions. so i never get a true in the c:when tag. is it not possible to combine the var from t:datalist with the jstl c:when condition?

here is a snipped from the jsp page:

newBeanColumnLeft is a ArrayList with class objects, echt DataType object has a String named type.

what i want is to choose with type is in the string and then call the right jsp page for the type...

...........

<t:dataList var="datatype" value="#{newBean.columnLeft}" id="d_columnLeft" layout="orderedList">

<h:outputText value="#{datatype.type}" />

<%@ include file="/jsp/view/snippet/"<%= newBean. %>".jsp" %>

<c:choose>

<c:when test='${datatype.type == "plaintext_single"}'>

<f:subview id="plaintext_single">

<%@ include file="/jsp/view/snippet/plaintext_single.jsp" %>

</f:subview>

</c:when>

<c:when test='${datatype.type == "plaintext_multi"}'>

<f:subview id="plaintext_multi">

<%@ include file="/jsp/view/snippet/plaintext_multi.jsp" %>

</f:subview>

</c:when>

................

<c:otherwise>

<f:subview id="error">

<%@ include file="/jsp/view/snippet/error.jsp" %>

</f:subview>

</c:otherwise>

</c:choose>

</t:dataList>

.............

so the programm runs only in the c:otherwise tag, but the values from the datalist are correct and get a hit with one of the c:when's...

any idea ?

Stefan

[2045 byte] By [sklefischa] at [2007-11-27 1:44:58]
# 1

Most likely is that the value is just out of the scope.

Why don't you gently use the rendered attribute of the JSF component instead?

For example:<f:subview rendered="#{datatype.type == 'plaintext_single'}">

This article might provide some useful insights tho: http://balusc.xs4all.nl/srv/dev-jep-djs.html

BalusCa at 2007-7-12 1:04:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...
# 2
hi,thanks for the ultra fast reply and saving my day ;-) the rendered attribut works fine. mfgStefan
sklefischa at 2007-7-12 1:04:44 > top of Java-index,Enterprise & Remote Computing,Web Tier APIs...