This week's book giveaway is in the Performance forum.
We're giving away four copies of The Java Performance Companion and have Charlie Hunt, Monica Beckwith, Poonam Parhar, & Bengt Rutisson on-line!
See this thread for details.
Win a copy of The Java Performance Companion this week in the Performance forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Binding 'rendered' with non-boolean value

 
Abhishek Asthana
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to display some value only if it fulfills some condition.

In the following code, I want to render the <hutputText> only if item.pc_hdd > 0.


This value is int, so binding the rendered property with it, was of no use. How can we do this? Any ideas shall help!

Thanks
Abhishek
 
Akbar Basha R
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Try using the JSTL logic tags,



The logic tags are in "http://java.sun.com/jstl/core"

 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
No need for JSTL here. The rendered attribute accepts every boolean expression.

Soshould work.
 
Abhishek Asthana
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Heyy thanks both of you. I used the boolean expression method and it worked.
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're welcome.

To get an idea what's all possible with EL to get a boolean outcome, here are some examples:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic