--- Sgarlata Matt <[EMAIL PROTECTED]> wrote:
> David Graham wrote:
> > I'm confused by your setup:
> > <arg0 name="fieldname" key="label.bin.title"/>
> 
> Yeah, I was trying random stuff.  The final thing that worked was:
> 
> <field
>    property="description"
>    depends="maxlength">
>    <arg0 key="label.bin.title" resource="true"/>
>    <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
>    <var>
>      <var-name>maxlength</var-name>
>      <var-value>2000</var-value>
>    </var>
> </field>
> 
> I think this is a bug 
> (http://nagoya.apache.org/bugzilla/show_bug.cgi?id=23034) because 
> resource="true" should not be required, right?

That's correct, the default is true.  Maybe it's broken when you don't
provide a name attribute?

> 
> > The name attribute should be the name of the relevant validation rule
> > listed in the depends clause.  You only have maxlength in depends and
> > fieldname isn't a Struts validation.
> 
> Good to know.
> 
> > What happens when you do this?
> > <arg0 name="maxlength" key="label.bin.title"/>
> 
> Interesting, that works too.  So the complete <field> element is:
> 
> <field
>    property="description"
>    depends="maxlength">
>    <arg0 name="maxlength" key="label.bin.title"/>
>    <arg1 name="maxlength" key="${var:maxlength}" resource="false"/>
>    <var>
>      <var-name>maxlength</var-name>
>      <var-value>2000</var-value>
>    </var>
> </field>

That's the correct way to setup the validation.

> 
> Is the name attribute required?  It isn't needed for the required check.

No, it's not required.  If not provided, the key will be shared in that
position for all validation messages.

David

> 
> Matt
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 


__________________________________
Do you Yahoo!?
Yahoo! SiteBuilder - Free, easy-to-use web site design software
http://sitebuilder.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to