Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 822215 - Richfaces Kitchensink archetype - rich:validator does not validate on the client side the @Pattern constraint
Summary: Richfaces Kitchensink archetype - rich:validator does not validate on the cli...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: JBoss Enterprise WFK Platform 2
Classification: Retired
Component: Examples, RichFaces
Version: 2.0.0.ER5
Hardware: Unspecified
OS: Unspecified
low
low
Target Milestone: CR1
: 2.1.0
Assignee: Brian Leathem
QA Contact: Pavol Pitonak
URL:
Whiteboard: rf-kitchensink
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-05-16 16:15 UTC by Juraj Huska
Modified: 2014-09-30 23:37 UTC (History)
7 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-11-30 15:35:12 UTC
Type: Bug


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Red Hat One Jira Issue Tracker RF-12160 Major Closed rich:validator does not validate on the client side the @Pattern constraint 2013-03-12 11:09:43 UTC
Red Hat One Jira Issue Tracker RF-12583 Major Closed Typo in the makePatternAMatch CSV javascript function 2013-03-12 11:09:43 UTC

Description Juraj Huska 2012-05-16 16:15:00 UTC
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 19:16:19 UTC
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 21:10:58 UTC
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 23:16:03 UTC
Brian Leathem <bleathem@gmail.com> updated the status of jira RF-12160 to Resolved

Comment 5 JBoss JIRA Server 2012-10-30 23:16:03 UTC
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 17:10:18 UTC
bleathem indicates is done, will be part of WFK 2.1 CR1 build delivery to QE.

Comment 9 Karel Piwko 2012-11-30 15:35:12 UTC
Distributed as a part of WFK 2.1.0.GA release.

Comment 10 JBoss JIRA Server 2012-12-19 17:14:00 UTC
Juraj Húska <jhuska@redhat.com> updated the status of jira RF-12583 to Closed

Comment 11 JBoss JIRA Server 2012-12-19 17:14:00 UTC
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 18:15:00 UTC
Juraj Húska <jhuska@redhat.com> updated the status of jira RF-12160 to Closed

Comment 13 JBoss JIRA Server 2013-01-14 18:46:54 UTC
Brian Leathem <bleathem@gmail.com> updated the status of jira RF-12583 to Reopened

Comment 14 JBoss JIRA Server 2013-01-14 18:46:54 UTC
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 18:50:37 UTC
Brian Leathem <bleathem@gmail.com> updated the status of jira RF-12583 to Resolved

Comment 16 JBoss JIRA Server 2013-01-14 18:51:23 UTC
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.