Details

    • Type: Improvement Improvement
    • Status: Open
    • Priority: Minor Minor
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: Validator2
    • Component/s: Framework
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

      Description

      I entered something similar to this as a feature enhancement to the Struts
      validator prior to figuring out that this is really a commons-validator
      enhancement request. (See also I entered something similar to this as a feature enhancement to the Struts
      validator prior to figuring out that this is really a commons-validator
      enhancement request. (See also Bug #23351).

      The basic problem is, when working with forms that contain indexed properties,
      how do I use the validator to generate meaningful error messages, such as:

      "Employment #2: must specify a start date for primary employer 'Motown Music'."

      My recommendation is:

      1) Add a 'property' attribute to arg0-3 such that I can use the indexed
      properties as parameters to my messages.

      Example:
      <arg1 property="emps[].employerName"/>

      2) Add an 'index' literal such that I can pass the current index as a
      parameter to my messages.

      Example:
      <arg1 property="[].index"/> or <arg1 property="index"/>

      Whatever literal is used, it would also be nice to have it available in
      <var-value>. Used together with 'validwhen' it would be very helpful.

      Example:
      <field property="startDate" indexedListProperty="emps" depends="validwhen">
      ...
      <var-value>((index != '0') or (this != null))</var-value>
      ...

      -jim).

      The basic problem is, when working with forms that contain indexed properties,
      how do I use the validator to generate meaningful error messages, such as:

      "Employment #2: must specify a start date for primary employer 'Motown Music'."

      My recommendation is:

      1) Add a 'property' attribute to arg0-3 such that I can use the indexed
      properties as parameters to my messages.

      Example:
      <arg1 property="emps[].employerName"/>

      2) Add an 'index' literal such that I can pass the current index as a
      parameter to my messages.

      Example:
      <arg1 property="[].index"/> or <arg1 property="index"/>

      Whatever literal is used, it would also be nice to have it available in
      <var-value>. Used together with 'validwhen' it would be very helpful.

      Example:
      <field property="startDate" indexedListProperty="emps" depends="validwhen">
      ...
      <var-value>((index != '0') or (this != null))</var-value>
      ...

      -jim

        Activity

        Jim Prantzalos created issue -
        Hide
        Josh Cronemeyer added a comment -

        32695 looks like a duplicate of this to me. Someone might want to look into
        this. I was just about to submit this as a bug myself. I don't think it is an
        enhancement. The fact that the validator can generate messages that cannot be
        correctly delivered to the user is a bug. These two pieces of Struts weren't
        designed to work together in this respect.

        I need to be able to deliver the indexed error messages that the validator
        returns for indexedListProperty.

        Show
        Josh Cronemeyer added a comment - 32695 looks like a duplicate of this to me. Someone might want to look into this. I was just about to submit this as a bug myself. I don't think it is an enhancement. The fact that the validator can generate messages that cannot be correctly delivered to the user is a bug. These two pieces of Struts weren't designed to work together in this respect. I need to be able to deliver the indexed error messages that the validator returns for indexedListProperty.
        Henri Yandell made changes -
        Field Original Value New Value
        issue.field.bugzillaimportkey 23372 12340998
        Henri Yandell made changes -
        Key COM-847 VALIDATOR-133
        Assignee Jakarta Commons Developers Mailing List [ commons-dev@jakarta.apache.org ]
        Component/s Validator [ 12311135 ]
        Project Commons [ 12310458 ] Commons Validator [ 12310494 ]
        Affects Version/s unspecified [ 12311647 ]
        Niall Pemberton made changes -
        Component/s Framework [ 12311271 ]
        Niall Pemberton made changes -
        Summary [validator] Indexed properties as arg0-arg3 Indexed properties as arg0-arg3
        Fix Version/s Validator2 [ 12312175 ]
        Bugzilla Id 23372

          People

          • Assignee:
            Unassigned
            Reporter:
            Jim Prantzalos
          • Votes:
            1 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:

              Development