Hi all!

I want to use dojo/dijit widgets in an applicatioin. For example the
currency textbox like this:

Java:
public getPriceFloat()
{
  return currentProduct.getPrice().doubleValue();
}

Template:
<t:textfield t:id="price" t:value="priceFloat"
                                 dojoType="dijit.form.CurrencyTextBox"
                                 required="true"
                                 constraints="{fractional:true}"
                                 currency="EUR"/>


Currencytextbox ecpects a standard javascript "float" as value and
Tapestry's number translator renders it according to my (german) locale with
a comma instead of a dot as decimal separator (eg. value="123,45" instead of
value="123.45").

Now I could of course use a special datatype in these cases and provide a
custom translator, but it would be better to have a more general approach to
it, since in this case dojo/dijit would work with the english locale but not
with the german one, which is a bit ugly.

One solution could for example be a special annotation like
@Translate(false) or @NoTranslation or something like that which skips
locale specific translation, so I can override standard datatypes'
translation only in the cases I want without having to write (potentially) a
bunch of custom translators.

Or did I overlook some simple workaround?

Regards,
Otho

Reply via email to