format tagged value should allow customization of error messages
----------------------------------------------------------------

         Key: BPM-214
         URL: http://jira.andromda.org/browse/BPM-214
     Project: Bpm4Struts Cartridge
        Type: Improvement
    Versions: 3.1-RC1    
    Reporter: Lee Greiner
 Assigned to: Wouter Zoons 
    Priority: Minor


I have a format tagged value set to "minlengh 8, maxlength 16, pattern 
[a-z][a-z0-9]*". Currently there is no way to customize the error message of 
the "pattern" validator. validation.xml has no <msg> tag generated.

The following is currently auto generated:

<field property="userName" depends="required,mask,maxlength,minlength">
    <arg position="0" key="user.administration.new.user.add.param.user.name" />
    <arg position="1" name="maxlength" key="${var:maxlength}" resource="false"/>
    <arg position="1" name="minlength" key="${var:minlength}" resource="false"/>
    <var>
        <var-name>maxlength</var-name>
        <var-value><![CDATA[16]]></var-value>
    </var>
    <var>
    <var-name>mask</var-name>
        <var-value><![CDATA[^[a-z][a-z0-9]*$]]></var-value>
    </var>
    <var>
        <var-name>minlength</var-name>
        <var-value><![CDATA[8]]></var-value>
    </var>
</field>

I would like to see:

<field property="userName" depends="required,mask,maxlength,minlength">
    <arg position="0" key="user.administration.new.user.add.param.user.name" />
    <arg position="1" name="maxlength" key="${var:maxlength}" resource="false"/>
    <arg position="1" name="minlength" key="${var:minlength}" resource="false"/>
    <msg name="mask" 
key="user.administration.new.user.add.param.userName_pattern"/>
...

This would allow me to customize the error messages in the same way the 
validWhen tagged value allows me to. 

The mask validator is much like the validWhen validator. No precise error 
message can be auto generated. One currenlty gets a "Field is invalid" error 
when a "pattern" formatted attribute is invalid. Not very useful to the end 
user.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
   http://jira.andromda.org/secure/Administrators.jspa
-
If you want more information on JIRA, or have a bug to report see:
   http://www.atlassian.com/software/jira



-------------------------------------------------------
SF.Net email is sponsored by: Discover Easy Linux Migration Strategies
from IBM. Find simple to follow Roadmaps, straightforward articles,
informative Webcasts and more! Get everything you need to get up to
speed, fast. http://ads.osdn.com/?ad_id=7477&alloc_id=16492&op=click
_______________________________________________
Andromda-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/andromda-devel

Reply via email to