File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes JSF and the fly likes how to show/hide  controls in jsf Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » JSF
Reply Bookmark "how to show/hide  controls in jsf" Watch "how to show/hide  controls in jsf" New topic
Author

how to show/hide controls in jsf

alisha chenna
Greenhorn

Joined: May 01, 2007
Posts: 7
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
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

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.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
 
 
subject: how to show/hide controls in jsf
 
Threads others viewed
Hiding controls upon selection
Table in a List Box
Validating Mutiple fields in the list Box
how to make the first item of dropdown listbox tobe auto selected always
Hide/Show form fields
developer file tools

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture