You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Robert Hannebauer <ro...@hannebauer.org> on 2005/06/18 22:45:17 UTC

Textfield value transformation

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

i'm trying to implement a locale dependent ValidField. Yet i'm running
into problems with displayed values. Since my property is for example a
Double field and my locale is de_DE, the shown value in the textfield
has a "." in it. But the values must have "," to be properly parsed.

The component definition looks like
<component id="doubleField" type="ValidField">
   <binding name="value" expression="long"/>
   <binding name="validator" expression="beans.doubleValidator"/>
   <static-binding name="displayName" value="Long"/>
</component>

The doubleValidator is my own implementation which is using
NumberFormat format = NumberFormat.getNumberInstance(currentLocale);
result = format.parse(value);

Ok. The number is properly parsed, but the value in the textfield is
wrong. For example: "1,234" is parsed without errors, but then the
value "1.234" appears in the textfield, which is wrong.

I need something like this:
<component id="doubleField" type="ValidField">
   <binding name="value" expression="long"/>

   <binding name="displayFormatter" expression="longFormatter"/>

   <binding name="validator" expression="beans.doubleValidator"/>
   <static-binding name="displayName" value="Long"/>
</component>

An other value has to be displayed than currently saved.

Is it possible to do something like this? How?

Robert

ps:
I'm not a native english speaker. Please forgive my errors.


-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCtIfdu7yxnZcpRTYRAq3PAJ9OL0DDzgT62hF+vQTkdJm+XvNFZQCfWwM/
J3ZXTm9CdN4KhQtkHb9IZ2c=
=pez6
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org


Re: Textfield value transformation

Posted by Robert Hannebauer <ro...@hannebauer.org>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hello,

i have already found a solution for my problem with locale dependent
form validation.

My efforts can be found at
http://www.hannebauer.org/tapestry_localetest.html

It's in german only - sorry.
I hope someone will find my efforts useful and I will try to make a
patch for Tapestry.

Sincerely yours
   Robert
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)
Comment: Using GnuPG with Thunderbird - http://enigmail.mozdev.org

iD8DBQFCtYjuu7yxnZcpRTYRAs15AJwPQtzP/Jr6eqAPY+yC5y09/FXncgCaA5vy
cdfp/xNZVT/eGEb8XIoC+ks=
=nSJN
-----END PGP SIGNATURE-----

---------------------------------------------------------------------
To unsubscribe, e-mail: tapestry-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: tapestry-user-help@jakarta.apache.org