MyFaces Extensions Validator
  1. MyFaces Extensions Validator
  2. EXTVAL-141

allow group validation triggered via an action-method

    Details

    • Type: New Feature New Feature
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 2.0.4
    • Fix Version/s: 2.0.7
    • Component/s: Bean Validation
    • Labels:
      None

      Description

      extval doesn't support the validateBean tag to keep the type-safety of bv-groups (instead @BeanValidation is provided). however, also the tag isn't what users need when it comes to group validation in several cases. with the tag it's just possible to specify groups for input components or disable bv with the disabled attribute.

      a lot of cases just require different actions within a form which should process the whole form in a different manner (= different or no bv-group/s). furthermore, there are several use-cases which require to bypass the validation process e.g. via a special group which isn't used for bv-constraints (see EXTVAL-142). in such cases the usage of the immediate attribute doesn't fit and the usage of the disabled attribute is more like a workaround.

      extval already provides @BeanValidation to 'useGroups' and 'restrictGroups' (optionally for specific views via 'viewIds' and/or specific conditions via 'conditions'). this feature allows to re-use this annotation also for action methods. so it's possible to use it for the scenarios mentioned above as well as EXTVAL-142.

      a simple example:

      @BeanValidation(useGroups = MyGroup.class)
      public String send()

      { //... return "success"; }

      a button which is bound to this action method will remove all configured groups of the current form for the current request, add the groups listed in 'useGroups' and locks the internal context until the invoke application phase to avoid that further groups get added.
      we can also think about just adding the groups and use 'restrictGroups' to remove the groups which shouldn't be used. and only SkipValidation of EXTVAL-141 would trigger the behaviour described before.

        Issue Links

          Activity

            People

            • Assignee:
              Gerhard Petracek
              Reporter:
              Igor Guimaraes
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development