Thanks for this Marcus, however, it only works like this:

<input jwcid="@TextField" translator="translator:string"/>

As soon as I add "empty=":

<input jwcid="@TextField" translator="translator:string,empty="/>

 I get the following exception:

Unable to instantiate instance of class
org.apache.tapestry.form.translator.StringTranslator:
java.lang.reflect.InvocationTargetException

Any idea what might be wrong ?
Henri

On 06/10/05, Marcus Brito <[EMAIL PROTECTED]> wrote:
> Henri Herscher <henri.herscher <at> gmail.com> writes:
>
> > It looks like a TextField now returns a null string instead of an
> > empty string. Is there a simple way to revert to the old behaviour ?
> > I'm getting null pointer exceptions all over the place.
>
> TextField now uses a translator to figure out how to convert the user-typed 
> text
> into the desired target class (different from T3, TextField now can be bound 
> to
> properties of any type, not only String).
>
> The default translator, if not specified, is "translator:string", and
> unfortunately it translates empty strings into as null. You can change this
> behaviour specifying a different translator for your TextField:
>
> <input jwcid="@TextField" translator="translator:string,empty="/>
>
> This looks weird, but should work. As a sidenote, it would be nice if there 
> was
> a global switch or something like this to control this behaviour; you'll 
> usually
> convert ALL your empty strings to null, or keep them ALL as empty strings.
>
> -- Marcus Brito
>
>
> ---------------------------------------------------------------------
> 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