Bug 822215
| Summary: | Richfaces Kitchensink archetype - rich:validator does not validate on the client side the @Pattern constraint | ||
|---|---|---|---|
| Product: | [Retired] JBoss Enterprise WFK Platform 2 | Reporter: | Juraj Huska <jhuska> |
| Component: | Examples, RichFaces | Assignee: | Brian Leathem <bleathem> |
| Status: | CLOSED CURRENTRELEASE | QA Contact: | Pavol Pitonak <ppitonak> |
| Severity: | low | Docs Contact: | |
| Priority: | low | ||
| Version: | 2.0.0.ER5 | CC: | bsutter, jpapouse, kpiwko, mnovotny, myarboro, ppitonak, rruss |
| Target Milestone: | CR1 | ||
| Target Release: | 2.1.0 | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | rf-kitchensink | ||
| Fixed In Version: | Doc Type: | Bug Fix | |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2012-11-30 15:35:12 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
Brian Leathem <bleathem> made a comment on jira RF-12160 Juraj Huska <jhuska> 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 Brian Leathem <bleathem> 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. Brian Leathem <bleathem> updated the status of jira RF-12160 to Resolved Brian Leathem <bleathem> made a comment on jira RF-12160 The cause of this has been reported and resolved with RF-12583. bleathem indicates is done, will be part of WFK 2.1 CR1 build delivery to QE. Distributed as a part of WFK 2.1.0.GA release. Juraj Húska <jhuska> updated the status of jira RF-12583 to Closed Juraj Húska <jhuska> made a comment on jira RF-12583 Verified by Jan P. Juraj Húska <jhuska> updated the status of jira RF-12160 to Closed Brian Leathem <bleathem> updated the status of jira RF-12583 to Reopened Brian Leathem <bleathem> made a comment on jira RF-12583 Re-opening to set component. Brian Leathem <bleathem> updated the status of jira RF-12583 to Resolved Brian Leathem <bleathem> updated the status of jira RF-12583 to Closed |
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