File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Binding 'rendered' with non-boolean value

 
Abhishek Asthana
Ranch Hand
Posts: 146
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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
  • 0
  • 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:
 
I agree. Here's the link: http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic