[ http://issues.apache.org/jira/browse/VALIDATOR-133?page=all ]
Niall Pemberton updated VALIDATOR-133:
--------------------------------------
Bugzilla Id: (was: 23372)
Summary: Indexed properties as arg0-arg3 (was: [validator] Indexed
properties as arg0-arg3)
Fix Version/s: Validator2
> Indexed properties as arg0-arg3
> -------------------------------
>
> Key: VALIDATOR-133
> URL: http://issues.apache.org/jira/browse/VALIDATOR-133
> Project: Commons Validator
> Issue Type: Improvement
> Components: Framework
> Environment: Operating System: All
> Platform: All
> Reporter: Jim Prantzalos
> Priority: Minor
> Fix For: Validator2
>
>
> 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
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]