Wicket FloatConverter setNumberFormat -
in wicket 6 floatconverter class had setnumberformat method.
in wicket 7 no longer available.
i use modify default limit of 3 decimals text field. there different way this?
use abstractdecimalconverter#newnumberformat(locale)
this. can override , configure specifics.
public class myfloatconverter extends floatconverter { @override protected numberformat newnumberformat(final locale locale) { numberformat nf = numberformat.getinstance(locale); nf.setxyz(); // <<- customize numberformat here return nf; } }
the can setup converter default 1 in yourapplication.java:
@override protected converterlocator newconverterlocator() { converterlocator cl = super.newconverterlocator(); cl.set(float.class, new myfloatconverter()); return cl; } }
or in specific component overriding #getconverter(class)
method;
Comments
Post a Comment