aspose file tools*
The moose likes JSF and the fly likes How do I conditionally output text in JSF? 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 "How do I conditionally output text in JSF?" Watch "How do I conditionally output text in JSF?" New topic
Author

How do I conditionally output text in JSF?

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
Hi,

Currently I have this JSF output tag:

<hutputText value='#{ConfigGridPage.appConfig}' escape='false'/>

I only want to output this text block if the a request parameter, named "ConfigAction" is equal to "load" or "save". Otherwise, I want to output an empty string. How do I do this?

Thanks, - Dave
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Use the 'rendered' attribute.

Dave Alvarado
Ranch Hand

Joined: Jul 02, 2008
Posts: 436
A follow up question on this. Let's say if the condition is met, I want the normal outputText to be rendered, but if the condition fails, I instead want just "[]" to be output. How could I do that?

Thanks, - Dave
Bauke Scholtz
Ranch Hand

Joined: Oct 08, 2006
Posts: 2458
Two ways:


or
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: How do I conditionally output text in JSF?