permaculture playing cards*
The moose likes JSF and the fly likes rendered attribute of output Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "rendered attribute of output" Watch "rendered attribute of output" New topic
Author

rendered attribute of output

E Paisley
Greenhorn

Joined: Sep 22, 2008
Posts: 14
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

Joined: Oct 08, 2006
Posts: 2458
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

Joined: Sep 22, 2008
Posts: 14
I did end up getting it to work...

The following statements will work in the rendered attribute.


 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: rendered attribute of output