Leon Derks wrote:
> 
> I have a TextField that shows a double value.
> 
> But I want to format the value in the Textfield as a decimal with 4
> decimals (i.e. 0.1234)
> 
> In Tapestry there is a NumericFormatter and a BigDecimalNumericFormatter.
> But I can't find any documentation on how to use these on a TextField.
> Can someone give me an example how I can format my double value into a
> decimal value with 4 decimals?
> 
> regards,
> Leo
> 

For input fields (such as TextField) you can add a parameter "translate" of
type FieldTranslator which translates between the object (e.g. BigDecimal)
and the String representation in the input.
See:
http://tapestry.apache.org/current/tapestry-core/ref/org/apache/tapestry5/corelib/components/TextField.html

You can also define your translator globally by contributing to
TranslatorSource.

-- 
Chris

--
View this message in context: 
http://tapestry.1045711.n5.nabble.com/NumberFormatter-tp4894812p4894939.html
Sent from the Tapestry - User mailing list archive at Nabble.com.

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@tapestry.apache.org
For additional commands, e-mail: users-h...@tapestry.apache.org

Reply via email to