Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

If - else with JSF ?

 
Kurt Boets
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello,

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"
value="#{ArrayToIterate}"
var="TEST">

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



Thx.
 
Varun Khanna
Ranch Hand
Posts: 1400
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are you tring to do ?
I think using dataTable you can easily do this by just specifying rowClasses attribute.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic