• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

how to show/hide controls in jsf

 
Greenhorn
Posts: 7
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Saloon Keeper
Posts: 27763
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic