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
JavaRanch » Java Forums » Java » JSF
Bookmark "JSF:validating primefaces selectOneMenu" Watch "JSF:validating primefaces selectOneMenu" New topic

JSF:validating primefaces selectOneMenu

prashant kumar g

Joined: Jun 11, 2013
Posts: 1

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:message for="qly" />
Tim Holloway
Saloon Keeper

Joined: Jun 25, 2001
Posts: 17417

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:

An IDE is no substitute for an Intelligent Developer.
I agree. Here's the link:
subject: JSF:validating primefaces selectOneMenu
It's not a secret anymore!