Details
Description
I think it will be straightforward to let the converter of a component handle the same type <T> that the component itself uses
----------------------
public class MyMoneyTextField extends TextField<BigDecimal>
{
public MyMoneyTextField(final String id, final IModel<BigDecimal> model)
// ...
@Override
public IConverter<BigDecimal> getConverter(final Class<BigDecimal> type)
{
// no ugly casts here anymore
//
return new IConverter<BigDecimal>()
{
public BigDecimal convertToObject(final String value, final Locale locale)
public String convertToString(final BigDecimal value, final Locale locale)
{ // ... }
};
}
}
I attached a patch that implements this change and ask you to take a look at and integrate it if you consider it right and helpful.
Best regards
Peter