This week's book giveaways are in the Refactoring and Agile forums.
We're giving away four copies each of Re-engineering Legacy Software and Docker in Action and have the authors on-line!
See this thread and this one for details.
Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

JSF:validating primefaces selectOneMenu

 
prashant kumar g
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

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
Pie
Posts: 18025
47
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic