<shameless_plug>

(with slow music playing in background)

On 9/1/05, Joe Germuska <[EMAIL PROTECTED]> wrote:
> At 4:32 PM -0400 9/1/05, Laurie Harper wrote:
> >You can register an instance of Converter that knows what
> >format string to use each time you call copyProperties().
> 
> However, if you have one bean that has two properties of the same
> type that will be set with strings which require different
> translation strategies, you're stuck.

(now the faster tune TV ad jingle)

Not if you're using FormDef !

    <form name="myForm"
        beanType="com.my.dto.MyBean">
        <field property="dateField1">
            <converter param="MMM dd, yyyy"/>
        </field>
        <field property="dateField2">
            <converter param="yyyy-MM-dd"/>
        </field>
    </form>

Combined with getFormValues()/setFormValues(), parse and format each
field the way you want!  You can even specify a key into your resource
bundle so different locales have different formats!
</shameless_plug>

Fortunately, Rivka's initial example had two forms whose date formats
were different.  In those cases, Rivka can use Laurie's approach.

Hubert

(A few more hours and it'll be Friday.)

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

Reply via email to