I've noticed that only when one of the component has changed value in the UI
of a form, then wicket calls updateFormComponentModels.
I was wondering if there is any way to force an update to the model of the
components even if none of the form components has changed value.
Thank you,
Greg
--
updateFormComponentModels() is called on each form submit (given no validation
error occurred).
I've noticed
How have you noticed the opposite?
Regards
Sven
On 04/28/2012 03:41 PM, albgentius wrote:
I've noticed that only when one of the component has changed value in the UI
of a form,
That's because Component#setDefaultModelObject is called internally. It
uses an IModelComparator to check whether the model object needs to be
changed. The default implementation uses an Object#equals() check. So if
the new value is equal to the old value it ignores the call.
If you want
I haven't seen updateFormComponentModels() being called if none of the values
has changed in UI.
That to me means that the model is not being changed(updated). It make sense
since nothing has really changed but I want to force wicket to update even
though nothing has changed.
Hope that is clear.
Please try out with the wicket FormInput example. When you put a
breakpoint on updateFormComponentModels() it will stop every time,
regardless whether the input has changed.
Perhaps you've got an unnoticed validation error? Do you have a
FeedbackPanel on your Page?
Sven
On 04/28/2012 07:37
Thank you very much,
I will give that a try.
Greg
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/force-model-update-on-a-wicket-form-tp4594765p4595374.html
Sent from the Users forum mailing list archive at Nabble.com.
No there are no validation errors as far as I know.
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/force-model-update-on-a-wicket-form-tp4594765p4595383.html
Sent from the Users forum mailing list archive at Nabble.com.