This week's book giveaway is in the Android forum.
We're giving away four copies of Head First Android and have Dawn & David Griffiths 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 Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Setting current value in SelectItem" Watch "Setting current value in SelectItem" New topic

Setting current value in SelectItem

Steve Aye

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.

I agree. Here's the link:
subject: Setting current value in SelectItem
It's not a secret anymore!