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 Android Security Essentials Live Lessons 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: http://aspose.com/file-tools
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