File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes If - else with JSF ? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSF
Bookmark "If - else with JSF ?" Watch "If - else with JSF ?" New topic

If - else with JSF ?

Kurt Boets

Joined: Oct 19, 2004
Posts: 14

I would like to perform a check while iterating over an Array. If
the value is equal to a certain number , the background must be blue, white otherwise.

In old jsp it would be something like:
<% for(int i=0;i<ArrayToIterate.length;i++){
if(ArrayToIterate.value) == 2{ %>
<td bgcolor="blue">BLaBLA</td>
<% }else{ %>
<td bgcolor="white">BLaBLA</td>

How do you do it in JSF ?
This is my for loop...

<x ataList id="something"

and here I want to perform a check ->
<h utputText value="#{ArrayToIterate.value}" />

Varun Khanna
Ranch Hand

Joined: May 30, 2002
Posts: 1400
What are you tring to do ?
I think using dataTable you can easily do this by just specifying rowClasses attribute.

- Varun
I agree. Here's the link:
subject: If - else with JSF ?
jQuery in Action, 3rd edition