How about using an IConverter since the issue is not about the data itself
but the representation of it?
For example, you could create a Label class that overrides the
getConverter() and return a BigDecimalConverter object that overrides
the getNumberFormat method to return something like
I added a setter for each property, but it's still not working (tried
matching field types as well). I guess I'll just have to stick with the
IModel route, even though I don't like it.
I changed the Doubles to BigDecimal, thanks for the reminder.
--
Sent from:
Hi,
The "problem" you face is that Wicket tries to find both getter and setter
[1] and if any of them do not exist then it falls back to the field.
I'd continue using a custom IModel for this use case.
And I'd also change the type of the "amount" to BigDecimal! Doing math with
doubles when
Wicket 7.9.0.
I have a Java double that is linked to a Wicket Label. This double
represents a dollar amount, so I want to work with it as a double for math
purposes. When I display it on the page however, I want it to a be a
currency formatted String.
I figured I would just add a getter to my