This week's book giveaway is in the Java 8 forum.
We're giving away four copies of Java 8 in Action and have Raoul-Gabriel Urma, Mario Fusco, and Alan Mycroft on-line!
See this thread for details.
The moose likes JSF and the fly likes Validating a selectOneMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Java 8 in Action this week in the Java 8 forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "Validating a selectOneMenu" Watch "Validating a selectOneMenu" New topic
Author

Validating a selectOneMenu

Steve Watson
Ranch Hand

Joined: Apr 08, 2003
Posts: 38
I have a selectOneMenu input with several selectItem tags in it. The first selectItem, the default just displays "Please Select". I want to validate that one of the other values is selected - i.e. not this first one. How can I do that? Code example follows:

<h:selectOneMenu binding="#{backing_appointmentRequest.country}"
id="country">
<f:selectItem itemLabel="Please Select" itemValue="please_select"
binding="#{backing_appointmentRequest.please_selecect}"
id="please_selecect"/>
<f:selectItem itemLabel="United States" itemValue="united_states"
binding="#{backing_appointmentRequest.united_states}"
id="united_states"/>
<f:selectItem itemLabel="Canada" itemValue="canada"
binding="#{backing_appointmentRequest.canada}"
id="canada"/>
</h:selectOneMenu>
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Validating a selectOneMenu
 
Similar Threads
i am facing some problem with <h:selectOneMenu>
A Problem with events
Navigation using valueChangeListener
can anybody help ??
Problem with loading the data after Value Change Listener on selectonemenu