wood burning stoves 2.0*
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 Android Security Essentials Live Lessons this week in the Android 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: 15959
    
  19

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.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: JSF:validating primefaces selectOneMenu
 
Similar Threads
Updating a form in primefaces when a selection is made in the datatable
hibernate
problem with header height in primefaces tabview
multiple form in xhtml page nad update different controlls on two different forms
"Fake" Dynamic Field to Form [using rendered]