You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commons.apache.org by bu...@apache.org on 2003/09/23 23:49:02 UTC

DO NOT REPLY [Bug 23372] New: - Validator Enhancement: indexed properties as arg0-arg3

DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23372>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23372

Validator Enhancement: indexed properties as arg0-arg3

           Summary: Validator Enhancement: indexed properties as arg0-arg3
           Product: Commons
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: Enhancement
          Priority: Other
         Component: Validator
        AssignedTo: commons-dev@jakarta.apache.org
        ReportedBy: dprantzalos@yahoo.com


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

---------------------------------------------------------------------
To unsubscribe, e-mail: commons-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: commons-dev-help@jakarta.apache.org