Re: force model update on a wicket form

2012-04-29 Thread albgreg
This did it. Thank you very much.
Greg

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/force-model-update-on-a-wicket-form-tp4594765p4596253.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



Re: force model update on a wicket form

2012-04-28 Thread Sven Meier

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, 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

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/force-model-update-on-a-wicket-form-tp4594765p4594765.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



Re: force model update on a wicket form

2012-04-28 Thread Christoph Leiter
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 another behavior (e.g. reference equality or to change it 
every time) then override Component#getModelComparator in your component 
to provide an appropriate IModelComparator.



Christoph


albgentius (2012-04-28 15:41):

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

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/force-model-update-on-a-wicket-form-tp4594765p4594765.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



Re: force model update on a wicket form

2012-04-28 Thread albgentius
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.

Greg

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/force-model-update-on-a-wicket-form-tp4594765p4595041.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



Re: force model update on a wicket form

2012-04-28 Thread Sven Meier
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 PM, albgentius wrote:

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.

Greg

--
View this message in context: 
http://apache-wicket.1842946.n4.nabble.com/force-model-update-on-a-wicket-form-tp4594765p4595041.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



Re: force model update on a wicket form

2012-04-28 Thread albgentius
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.

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



Re: force model update on a wicket form

2012-04-28 Thread albgentius
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.

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