about your earlier message.... ok i did misunderstand....

okay....



did you know bean:message not only takes a key but the trinity of
attributes...

i define the trininty of attributes as name, property, scope....


thus,

<bean:message name="simpleForm" property="widgetDescription"
scope="session"/>


the above would call simpleForm.getWidgetDescription(), which would return a
key into the resouce bundle. just prep the form before you got to the page
by going to an action that loads the form page.


As far as validation goes.....

Hmmmmm.....

Did you know that validation is not keyed off of the form name
(name="fooForm"), but off of the attribute (attribute="fooForm")? (I found
out the hard way).

You could use two action mappings, one for one type of message, one for the
other type of message by messages I mean form labels. Then you would need to
entries for the form in the validation.xml file as well.




-----Original Message-----
From: Janice [mailto:[EMAIL PROTECTED]
Sent: Friday, January 16, 2004 11:40 AM
To: [EMAIL PROTECTED]
Subject: Issues when reusing a DynaValidatorForm


Thanks Richard, but I think mayhaps I didn't explain myself very well the
first time, because I'm not sure that a mapped backed property will do it
for me.  That or I just don't understand what a mapped backed property is :)

I want a "name" property on all of the forms that are using my
DynaValidatorForm, but I want the text next to the field to read something
different.  So its the <bean:message key="widget.desc"/> that I want to
change from page to page.  So far simply having distinct .jsps is working,
but I'd like to reduce the duplicated code.

The validator is the other part of the problem... so far its looking like
this:
    <form name="simpleForm">
      <field property="code" depends="required">
        <arg0 key="common.validate.code"/>
      </field>
      .....
But I want the key to be page specific.

Thanks,
Janice


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


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

Reply via email to