help with use of BigDecimalConverter

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view

help with use of BigDecimalConverter

we have built our simple application with wicket and now getting into the more "advanced" stuff.

we have some money fields that we want to format to 2 decimal places. validation is already done. i am thinking we can use BigDecimalConverter but not sure how to start. here is our exisitng code

TextField inputField = new TextField<String>("edit");
inputField.setModel(fieldModel); // big decimal in our java object

i thought i could do :
TextField inputField = new TextField("creditLimit", BigDecimal.class) {
    public IConverter getConverter()
        return new BigDecimalConverter();

but it says cannot override getConverter() - overriden method is final

can someone give me a hand? am i on the right track? is BigDecimalConverter the way to go? thank you