This week's giveaway is in the Android forum.
We're giving away four copies of Android Security Essentials Live Lessons and have Godfrey Nolan on-line!
See this thread for details.
The moose likes JSF and the fly likes JSTL + JSF - why wont this work? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSTL + JSF - why wont this work?" Watch "JSTL + JSF - why wont this work?" New topic
Author

JSTL + JSF - why wont this work?

Dowell Griffin
Greenhorn

Joined: Dec 06, 2004
Posts: 8
I am a JSTL newbie.

Why wont this work? (see below) The JSTL parses properly but what is rendered is not valid. I want different row classes based on a test result. I tried just the rowClasses part of the code with no success. Then I tried the whole dataTable as shown below. DOes anyone see anything wrong? I can cut and paste each option individually and it works.

<c:choose>
<c:when test="#{common.entityBean.editOrNewMode}">
<h:dataTable
rowClasses="rowClear"
styleClass="dataTable"
align="center"
var="row"
value="#{unitsList.resultList}"
columnClasses="allCols">
</c:when>
<ctherwise>
<h:dataTable
rowClasses="rowClear,rowShaded"
styleClass="dataTable"
align="center"
var="row"
value="#{unitsList.resultList}"
columnClasses="allCols">
</ctherwise>
</c:choose>
Dowell Griffin
Greenhorn

Joined: Dec 06, 2004
Posts: 8
SOLVED:

Used pure JSF solution:

rowClasses="#{common.entityBean.editOrNewMode?'rowClear':'rowClear,rowShaded'}"
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: JSTL + JSF - why wont this work?
 
Similar Threads
NOT EMPTY or NOT NULL?
Conditional alerts (was 'c:otherwise tag')
EL fails to work in data table
Cannot set parameter in HTML:Link
c:choose not working with ajax