aspose file tools
The moose likes JSF and the fly likes rendered attribute of output Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login


Win a copy of The Mikado Method this week in the Agile and other Processes forum!
JavaRanch » Java Forums » Java » JSF
Reply 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:


Code depot of a Java EE / JSF developer | JSF / Eclipse / Tomcat kickoff tutorial | DAO kickoff tutorial | I ♥ Unicode
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://ej-technologies/jprofiler - if it wasn't for jprofiler, we would need to run our stuff on 16 servers instead of 3.
 
subject: rendered attribute of output
 
Similar Threads
Adding components dynamically
Client side rendeing
If in JSF - Conditionaly displaying content
To the authors: Dynamically add components
JSF table