Details

    • Type: New Feature New Feature
    • Status: Closed
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.1.11
    • Component/s: JSF2
    • Labels:
      None
    • Environment:
      *

      Description

      I've been playing with Bean Validation and JSF2 ClientBehavior. I've written a simple ClientBehavior which renders JavaScript validations, based on the Bean Validation constraints.

      The developer only needs to nest a <s:validateBean /> into a UICommand component and the Behavior renders the necessary JavaScript.

      As I said, it's a start. It currently only supports some validations:

      • JSF required attribute.
      • Numeric and date formats, based on how the converter is configured (i.e. a pattern like: "dd-MM-yyyy").
      • Bean Validation @NotNull, @Min, @Max and @Future.

      It should be usable in Mojarra, since I simply copied the MyFaces dependencies to the component (ExternalSpecifications.java, FacesMessageInterpolator.java and the other Bean Validation related classes).

      It still needs some work (like supporting other annotations, and more datestyle patterns), but it's a start.

      So I was thinking about committing it into the Sandbox, under: http://svn.apache.org/repos/asf/myfaces/tomahawk/trunk/core20/

      I think this concept (when the implementation is ready) is really powerful and a nice addition to the project.

      I've written two blog articles where I give a little overview:
      http://blog.smart-java.nl/blog/index.php/2010/03/17/jsf-2-0-clientbehavior-bean-validation-in-javascript/
      http://blog.smart-java.nl/blog/index.php/2010/03/19/jsf-2-0-clientbehavior-first-impressions/

      When done Mavenizing, I'll add an attachment with all source code.

      What do you guys think? Should we add it to the project?

      1. validateBeanBehavior.zip
        22 kB
        Jan-Kees van Andel

        Activity

        Leonardo Uribe made changes -
        Status Resolved [ 5 ] Closed [ 6 ]
        Leonardo Uribe made changes -
        Fix Version/s 1.1.11 [ 12316480 ]
        Fix Version/s 1.1.11-SNAPSHOT [ 12315372 ]
        Leonardo Uribe made changes -
        Status Open [ 1 ] Resolved [ 5 ]
        Fix Version/s 1.1.11-SNAPSHOT [ 12315372 ]
        Resolution Fixed [ 1 ]
        Leonardo Uribe made changes -
        Component/s JSF2 [ 12313542 ]
        Jan-Kees van Andel made changes -
        Field Original Value New Value
        Attachment validateBeanBehavior.zip [ 12439407 ]
        Jan-Kees van Andel created issue -

          People

          • Assignee:
            Jan-Kees van Andel
            Reporter:
            Jan-Kees van Andel
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development