aspose file tools*
The moose likes JSF and the fly likes JSF:validating primefaces selectOneMenu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF:validating primefaces selectOneMenu" Watch "JSF:validating primefaces selectOneMenu" New topic
Author

JSF:validating primefaces selectOneMenu

prashant kumar g
Greenhorn

Joined: Jun 11, 2013
Posts: 1

Hello,
I'm hoping someone can help me.
i am not able to validate select box.
<p:message for="interests" />


<h:outputLabel value="Select one value" />

<p:selectOneMenu value="#{testBean.selectedItem}" validatorMessage="required" id="qly">

<f:selectItem itemValue="?" itemLabel="--Select--" />
<f:selectItems value="#{testBean.selectItems}" />
<f:validateRegex pattern="[^?]" summaryMessage="please provide appropriate value"></f:validateRegex>
</p:selectOneMenu>
<p:message for="qly" />
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 16305
    
  21

Normally we'd admonish you to give more information. "It doesn't work" doesn't tell us anything.

But I am totally puzzled by your use of a regex validator on a dropdown selection list. When the choices you can make are limited by what's in the list, using regexes to validate them doesn't make any sense. :confused:


Customer surveys are for companies who didn't pay proper attention to begin with.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSF:validating primefaces selectOneMenu