Hey all,
I have a component, ResponseArea, that get's a
HibernateObjectModel<Response>. This ResponseArea then passes that same
model down to it's sub components (ResponseEditor, ResponseViewer).
ResponseEditor passes this model further down to a Form<Response>. I have
some jQuery script that does a timed autosave submit of this form.
When the form submits, I do this (pseudocode):
Response newR = new Response();
newR.setData(Form.this.get("dataField").getDefaultModelObjectAsString();
saveResponse(Form.this.getModelObject(), newR);
The last step of the saveResponse(Response oldR, Response newR) method does
some processing, comparing the two versions of the response, and finally
calls:
ResponseEditor.this.setDefaultModelObjet(newR);
Now, I expect this effect to propagate up to the parent ResponseArea and
down to the Form to be ready for the next AutoSave. The problem is this:
At some point in the processing, the Form seems to clone the model and never
gets the new object - it retains the original object as its model object.
So instead of this behavior
1st Autosave Execute: saveResponse(original, respond1)
2nd Autosave Execute: saveResponse(respond1, respond2)
3rd Autosave Execute: saveResponse(respond2, respond3)
I get this:
1st Autosave Execute: saveResponse(original, respond1)
2nd Autosave Execute: saveResponse(original, respond2)
3rd Autosave Execute: saveResponse(original, respond3)
Since my form would like to see progressive changes, this doesn't work.
Thoughts?
I sense IComponentInheritedModel is involved, but I'm surprised that this
isn't a native behavior. It also seems to work in every other case - so why
not now?
Thanks!
Jake
--
View this message in context:
http://apache-wicket.1842946.n4.nabble.com/Model-not-Updating-on-Multiple-Form-Submits-tp2272644p2272644.html
Sent from the Wicket - User mailing list archive at Nabble.com.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]