• Post Reply Bookmark Topic Watch Topic
  • New Topic

how to show/hide controls in jsf  RSS feed

 
alisha chenna
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

I am new to java and jsf. In my page i have selectonemenu(list box). When i select a value from a list box like vehicle.It should display fields like vehicleType and vehicleColor. If i select something else from the list box it should hide those fields. Can anyone help me with this.

Thanks.
 
Tim Holloway
Bartender
Posts: 18531
61
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Two ways are possible. The first one is to alter the display properties by submitting the page and having it update.

The second way is much preferred - attach JavaScript event handlers to manage everything client-side. Response times are much better, but the server won't know what you've done until it gets submitted. And paranoid people may have switched off JavaScript in their browsers, so the page won't work properly.

I prefer a "blended" approach, where JavaScript is the first choice, and hitting the server is done for JavaScript-disabled clients. However, that's double the development work unless you can find some good JSF components pre-written to do that for you.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!