| Author |
Hide/Show form fields
|
Pradeep Chandrasekharan Nair
Ranch Hand
Joined: Apr 01, 2004
Posts: 48
|
|
Hi, Is there any way to show/hide fields using JSF rather than javascript. Actually my scenario is that I have to show some fields if I select a particular value from <selectOneMenu> Thanks in Advance Regards, Pradeep
|
 |
Gabriel Claramunt
Ranch Hand
Joined: May 26, 2007
Posts: 375
|
|
Use the rendered attribute of the JSF components. I had a similar situation, and I used it successfully. The main selection used immediate="true" (to avoid validations), and the action in the backing bean was used to set a boolean flag (something like "modeA"), the other JSF components had rendered=#{backingBean.modeA} or rendered=#{!backingBean.modeA} if they should appear in mode A or not. Probably you can do it also with rendered=#{backingBean.selectionValue==XX} and avoid the use of a flag
|
Gabriel
Software Surgeon
|
 |
Pradeep Chandrasekharan Nair
Ranch Hand
Joined: Apr 01, 2004
Posts: 48
|
|
Thanks Gabriel. Its working. Pradeep
|
 |
 |
|
|
subject: Hide/Show form fields
|
|
|