Hi Martin,

we have components overriding #updateModel() (without calling super). You'd have to call #clearInput() from these places too :/.

I don't think it belongs into #updateModel() - the method does not indicate that it has anything to do with 'raw input'.
Yes, neither does #valid() :P.

Regards
Sven


On 08/04/2014 05:20 PM, Martin Grigorov wrote:
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


Reply via email to