Hi,
Looking at https://issues.apache.org/jira/browse/WICKET-5658 I start to
agree with the reporter that Wicket does it a bit wrong here.
AjaxFormComponentUpdatingBehavior has the following code:
if (formComponent.isValid())
{
formComponent.valid();
if (getUpdateModel())
{
formComponent.updateModel();
}
It calls formComponent.valid() (that internally calls #clearInput() and
#onValid()) and then calls formComponent.updateModel() if it is allowed to
do so (see https://issues.apache.org/jira/browse/WICKET-992).
What I find incorrect is that #clearInput() is called by #valid().
I think #clearInput() should be called by #updateModel() instead. I.e. only
when the converted input is stored as a model we should drop the raw input.
Do you see a problem with such change ?
Martin Grigorov
Wicket Training and Consulting
https://twitter.com/mtgrigorov