>checking the class parameter in the over-ridden getConverter(Class
type) method
>and only returning the DateConverter for a date object
Yes, you have to check the type parameter, as other types than the
component's model type might need a converter.
With WICKET-4608 all variables in error messages are now properly
converted by the formComponent.
This is why getConverter() is called more often.
Sven
On 11/29/2012 06:46 PM, Hobbes00uk wrote:
I'm hoping someone can help me with my understanding. I've been updating my
website to Wicket 6. In doing that the DateConverter I was applying to a
field has started throwing a class cast exception.
After some work, I made the problem go away, by checking the class parameter
in the over-ridden getConverter(Class type) method and only returning the
DateConverter for a date object - as it's shown in the DateTextField class.
All fine.
My confusion is that the class cast exception happens at the point where
Wicket is forming the error message. At that point it passes the name of the
field's label ("birth date" in this case) to the DateConverter's toString
method (which naturally expects a Date object) and hence the class cast
exception.
I just don't understand why it would do that? Why is the field label being
sent to the field's converter?
If I've misread what is happening then I apologize - I'm not an experienced
java coder but I have checked and rechecked this because I just couldn't
believe what I was seeing. And while I've made the problem go away, I'm
concerned I've achieved that with a profound lack of understanding as to why
it is happening.
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Validators-in-Wicket-6-tp4654349.html
Sent from the Users forum mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org