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 page for that property, with a
return type of String (and do the appropriate actions there). So for a
member variable called 'amount' of type Double, I have a getter as 'private
String getAmount()'. It's not working though, it still gets the value
directly from the property itself when displaying on the page (and seems to
get displayed as an int, at that).

I was using CompoundPropertyModel at first, then after something i read on 
StackOverflow
<https://stackoverflow.com/questions/548354/wicket-propertymodel-strangeness> 
, I changed it to a PropertyModel, but it's still not working. Does the
return type of the getter have to match the type of the variable, even if
the getter method has the appropriate name otherwise? I am currently going
with the method shown in the second answer by Andreas on that StackOverflow
question, but I'd rather it be done automatically through PropertyModel or
CompoundPropertyModel because it looks a lot cleaner.

--
Sent from: http://apache-wicket.1842946.n4.nabble.com/Users-forum-f1842947.html

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org

Reply via email to