Hi, i want to create a money/currency field but get confused on what the
I've been looking at custom validator, translator, mixin, even extending
tapestry TextField it self.
Basically the requirements is:
- When the user type 100000, it will be shown as a certain format (ex:
- There's a possibility/optional parameter that you can show the currency
If you are handling multiple currencies, consider using the datatype org.joda.money.Money throughout, except in the entity convert it to BigDecimal and a String currencyCode, and the database use decimal and varchar, respectively.
> On 26 Jul 2018, at 11:38 pm, abangkis <[hidden email]> wrote:
> Hi, i want to create a money/currency field but get confused on what the
> right approach.
> I've been looking at custom validator, translator, mixin, even extending
> tapestry TextField it self.
> Basically the requirements is:
> - When the user type 100000, it will be shown as a certain format (ex:
> - There's a possibility/optional parameter that you can show the currency
> symbol ($100.000)
> Can anyone give a little bit direction? Thanks
> http://www.mreunionlabs.net/ <http://www.mreunion-labs.net/>
> twitter : @mreunionlabs @abangkis
> page : https://plus.google.com/104168782385184990771
Hi geoff, thanks for the link. I was actually looking at the money
translator when I first researching. But i stumbled on the requirement
that it will format the entry when user typing the value. I looked it up,
The currency is only an extra label for now, appended at the front of
formatted input. So it's possible to just use parameters and didn't save it
to the database. But the Joda money is interesting, it will help if we want
to support multiple currencies stored in the db. Thanks.
Using the ECMAScript Internationalization API, we can let the browser do
the formatting. Now all i need is find/build a mixin that update the value
when user typing the input. And to get the real value when submitting to