Bug 822215 - Richfaces Kitchensink archetype - rich:validator does not validate on the client side the @Pattern constraint
Richfaces Kitchensink archetype - rich:validator does not validate on the cli...
Status: CLOSED CURRENTRELEASE
Product: JBoss Enterprise WFK Platform 2
Classification: JBoss
Component: Examples, RichFaces (Show other bugs)
2.0.0.ER5
Unspecified Unspecified
low Severity low
: CR1
: 2.1.0
Assigned To: Brian Leathem
Pavol Pitonak
rf-kitchensink
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2012-05-16 12:15 EDT by Juraj Huska
Modified: 2014-09-30 19:37 EDT (History)
7 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2012-11-30 10:35:12 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
JBoss Issue Tracker RF-12160 Major Closed rich:validator does not validate on the client side the @Pattern constraint 2013-03-12 07:09:43 EDT
JBoss Issue Tracker RF-12583 Major Closed Typo in the makePatternAMatch CSV javascript function 2013-03-12 07:09:43 EDT

  None (edit)
Description Juraj Huska 2012-05-16 12:15:00 EDT
Description of problem:
When trying to validate input which has annotation based constraint @Pattern, validation for this constraint is triggered only after the submitting of the form. The other constraints (@NotNull, @Size) are triggered as expected, after the BLUR event fired on that input.

The issue is noticeable on the project generated by the kitchensink archetype with RichFaces 4.2.1-SNAPSHOT libraries.

The facelet for the input validation with pattern annotation-based constraints looks like:

<h:panelGrid columns="3" columnClasses="titleCell">
      <h:outputLabel for="name" value="Name:"/>
      <h:inputText id="name" value="#{cc.attrs.member.name}">
         <rich:validator/>
      </h:inputText>
      <rich:message for="name" errorClass="invalid"/>
</h:panelGrid>
The model entity field which is validated in the above mentioned input:

@NotNull
@Size(min = 1, max = 25)
@Pattern(regexp = "[A-Za-z ]*", message = "must contain only letters and spaces")
private String name;

Note that I have tried to reproduce this issue on metamer and I was not successful.

Version-Release number of selected component (if applicable):
Richfaces 4.2.1.Final



Steps to Reproduce:
1. deploy on JBoss AS 7.1.1.Final the project generated by the richfaces kitchen sink archetype
2. type numbers to the name input, e.g. 444
3. make BLUR on that input, that is, focus other input
4. see that the respective error message did not appear
Comment 1 JBoss JIRA Server 2012-05-17 15:16:19 EDT
Brian Leathem <bleathem@gmail.com> made a comment on jira RF-12160

Juraj Huska <jhuska@redhat.com> made a comment on [bug 822215|https://bugzilla.redhat.com/show_bug.cgi?id=822215]

Description of problem:
When trying to validate input which has annotation based constraint @Pattern, validation for this constraint is triggered only after the submitting of the form. The other constraints (@NotNull, @Size) are triggered as expected, after the BLUR event fired on that input.

The issue is noticeable on the project generated by the kitchensink archetype with RichFaces 4.2.1-SNAPSHOT libraries.

The facelet for the input validation with pattern annotation-based constraints looks like:

{code}
<h:panelGrid columns="3" columnClasses="titleCell">
      <h:outputLabel for="name" value="Name:"/>
      <h:inputText id="name" value="#{cc.attrs.member.name}">
         <rich:validator/>
      </h:inputText>
      <rich:message for="name" errorClass="invalid"/>
</h:panelGrid>
{code}

The model entity field which is validated in the above mentioned input:

{code}
@NotNull
@Size(min = 1, max = 25)
@Pattern(regexp = "[A-Za-z ]*", message = "must contain only letters and spaces")
private String name;
{code}

Note that I have tried to reproduce this issue on metamer and I was not successful.

Version-Release number of selected component (if applicable):
Richfaces 4.2.1.Final
Comment 3 JBoss JIRA Server 2012-10-30 17:10:58 EDT
Brian Leathem <bleathem@gmail.com> made a comment on jira RF-12160

The javascript _RegExp_ created for the provided @Pattern is:
{code}
/^[A-Za-z ]*/
{code}

Evaluating this javascript _RegExp_ against a numerical value returns _true_.  To return false against a numerical value, the javascript RegExp should rather be (Note: the $ at the end of the pattern):
{code}
/^[A-Za-z ]*$/
{code}

This was supposed to be resolved with RF-11531, but it seems to not be working as expected.

Further investigation is required.
Comment 4 JBoss JIRA Server 2012-10-30 19:16:03 EDT
Brian Leathem <bleathem@gmail.com> updated the status of jira RF-12160 to Resolved
Comment 5 JBoss JIRA Server 2012-10-30 19:16:03 EDT
Brian Leathem <bleathem@gmail.com> made a comment on jira RF-12160

The cause of this has been reported and resolved with RF-12583.
Comment 7 mark yarborough 2012-11-05 12:10:18 EST
bleathem indicates is done, will be part of WFK 2.1 CR1 build delivery to QE.
Comment 9 Karel Piwko 2012-11-30 10:35:12 EST
Distributed as a part of WFK 2.1.0.GA release.
Comment 10 JBoss JIRA Server 2012-12-19 12:14:00 EST
Juraj Húska <jhuska@redhat.com> updated the status of jira RF-12583 to Closed
Comment 11 JBoss JIRA Server 2012-12-19 12:14:00 EST
Juraj Húska <jhuska@redhat.com> made a comment on jira RF-12583

Verified by Jan P.
Comment 12 JBoss JIRA Server 2012-12-19 13:15:00 EST
Juraj Húska <jhuska@redhat.com> updated the status of jira RF-12160 to Closed
Comment 13 JBoss JIRA Server 2013-01-14 13:46:54 EST
Brian Leathem <bleathem@gmail.com> updated the status of jira RF-12583 to Reopened
Comment 14 JBoss JIRA Server 2013-01-14 13:46:54 EST
Brian Leathem <bleathem@gmail.com> made a comment on jira RF-12583

Re-opening to set component.
Comment 15 JBoss JIRA Server 2013-01-14 13:50:37 EST
Brian Leathem <bleathem@gmail.com> updated the status of jira RF-12583 to Resolved
Comment 16 JBoss JIRA Server 2013-01-14 13:51:23 EST
Brian Leathem <bleathem@gmail.com> updated the status of jira RF-12583 to Closed

Note You need to log in before you can comment on or make changes to this bug.