Details

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

      Operating System: All
      Platform: All

    • Bugzilla Id:
      23372

      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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              dprantzalos@yahoo.com Jim Prantzalos
            • Votes:
              1 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

              • Created:
                Updated: