the call:
getParent().modelChanging();
should do it
BUT
look at the ModelChange class and then its constructor. (where you will end up)
final IModel model = component.getModel();
// If the component has a model, it's about to change!
if (model != null)
{
// Should we clone the model?
boolean cloneModel = true;
// If the component is a form component
if (model instanceof CompoundPropertyModel)
{
if (component instanceof FormComponent)
{
// and it's using the same model as the form
if (((FormComponent)component).getForm().getModel() == model)
{
// we don't need to clone the model, because it will
// be re-initialized using initModel()
cloneModel = false;
}
}
else
{
// If the component is using the same model as the page
if (component.getPage().getModel() == model)
{
// we don't need to clone the model, because it will
// be re-initialized using initModel()
cloneModel = false;
}
}
}
// Clone model?
if (cloneModel)
{
model.detach ();
originalModel = (IModel)Objects.cloneModel(model);
}
else
{
originalModel = model;
}
i don't know exactly where it falls in, but i guess the model will not be cloned.
But what you do in the end:
TestPage.this.addStateChange(new Change() {
public void undo()
{
((StatePojo)
getPage().getModelObject())
.setA(oldA);
}});
is a much much much better solution anyway!
You dont clone everything. It is much lighter variant, only the old object is kept alive..
johan
On 8/29/06, landtuna <[EMAIL PROTECTED]> wrote:
Eelco Hillenius wrote:
>
> Would you mind creating an issue for this, so we can track it/ won't
> forget to address it? Thanks,
>
Entered as issue 1548207.
--
View this message in context: http://www.nabble.com/Versioning-a-PropertyModel-backed-by-another-Model-tf2166294.html#a6029382
Sent from the Wicket - User forum at Nabble.com.
-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user
------------------------------------------------------------------------- Using Tomcat but need to do more? Need to support web services, security? Get stuff done quickly with pre-integrated technology to make your job easier Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________ Wicket-user mailing list Wicket-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/wicket-user