This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes JSF and the fly likes Setting current value in SelectItem Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Setting current value in SelectItem" Watch "Setting current value in SelectItem" New topic
Author

Setting current value in SelectItem

Steve Aye
Greenhorn

Joined: Mar 27, 2006
Posts: 2
Is there a way to set the current item in an h:selectOneMenu item? The list is comprised of an ArrayList of SelectItems where a user can choose a name to retrieve by. However, one of the options is <All> and when they click the clear button, I want to default that value back to <All>. Is there a way to set the current value of the selected item somehow?
Rajeev Ravindran
Ranch Hand

Joined: Aug 27, 2002
Posts: 455
if you want to set the value of dropdown on buttonclick you can do it using javascript

if that is not what you are looking for, please have a look at this thread.

Thanks,
 
 
subject: Setting current value in SelectItem
 
Similar Threads
How to use array of beans in jsp
XML Validation using XML Schema
Struts logic and html select
mandatory attributes for c:forEach
Generate Radio Buttons