File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSF and the fly likes Conditionally rendering fields in JSF 2.0 Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Conditionally rendering fields in JSF 2.0" Watch "Conditionally rendering fields in JSF 2.0" New topic

Conditionally rendering fields in JSF 2.0

David Lidz

Joined: Mar 30, 2011
Posts: 14
The only real implementation I can think of is by using Javascript to hide/show a tag.
But I want a more Ajax approach to it by sending the request to the server when the tag is to be rendered.
Is it possible to make such an implementation using Ajax in JSF 2.0?
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16901

I do it all the time. Just indicate that AJAX is to re-render the field(s), and have the AJAX-invoked server-side method set properties that can be queried in a "rendered=" attribute EL expression on the fields being re-rendered.

Customer surveys are for companies who didn't pay proper attention to begin with.
I agree. Here's the link:
subject: Conditionally rendering fields in JSF 2.0
It's not a secret anymore!