Regex/star caracter not working with rich:validator
jonathan.man Feb 11, 2012 2:17 PMRegex/star caracter not working with rich:validator
Hi everyone.
I'm trying to get rich:validator working with the f:validateRegex on the "blur" event.
I get the following regex working fine : [1-9]+
Whenever I put letters in the input field, the "blur" event show an error message.
However I have a problem with the "*" character.
The error message doesn't appear on the "blur" event with letters in the input field.
It works fine on the submit though.
Here is my xhtml :
<h:body>
<h:form>
<rich:panel header="Person" style="height: 500px;">
<h:panelGrid columns="2">
<h:outputText value="Name :" />
<h:inputText />
<h:outputText value="Surname :" />
<h:inputText />
<h:outputText value="Id :" />
<h:inputText validatorMessage="Error on Id">
<f:validateRegex pattern="[1-9]*" />
<rich:validator event="blur"/>
</h:inputText>
<h:outputText value="Phone :" />
<h:inputText validatorMessage="Error on Phone">
<f:validateRegex pattern="[1-9]+" />
<rich:validator event="blur"/>
</h:inputText>
<h:outputText value="Email :" />
<h:inputText />
<h:commandButton value="test"/>
</h:panelGrid>
</rich:panel>
<rich:messages/>
</h:form>
</h:body>
I'm pretty confident that I could get some other regex to do whatever i'd like todo, but I'd like to know :
Am I missing something here? Is my regex ok (allowing only numbers)?
Or is it some king of a bug (the error message appear correctly on the button submit, but not on the blur event).
I'm new to Richfaces so I wouldn't know.
Here is my setup :
JDK7
Tomcat7
JSF 2.1.3 (mojarra)
Richfaces 4.1.0 Final
On another note, is there a way to format code snippets on the forums?