Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

rendered attribute of output

 
E Paisley
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can you use a function inside of the rendered attribure?

Rendered takes a true/false value. What I'm trying to do is compare to backing bean values to determine if link should be displayed. Something like this:

rendered="#{!(frCodeBeingDisplayed == loggedInAs)}"

The above doesn't work. What I have found is that you can set rendered to a backing bean value (True or False), but I haven't found anything on a function that results in a true or false.

Can you set a function to a rendered attribute? Any suggestions would be appreciated
 
Bauke Scholtz
Ranch Hand
Posts: 2458
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You can use conditional expressions in EL. Maybe you just did it the wrong way. You didn't give enough information to give you the right answer. If you for example need to compare some value with a String, then you can do it as follows:
 
E Paisley
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I did end up getting it to work...

The following statements will work in the rendered attribute.


 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic