Hello,

I have been trying to figure out if having a Component as a class member
(and especially inside a Model) will cause it to be serialized mutliple
times.

>From what I have gathered so far, stateful pages always serialize their
components. But is there a danger of serializing the Component more than
once? Or is wicket smart enough to only hold references to the serialized
instance after the first serialization?

 For example, take the following model:

public class VisibilityModel extends Model<Boolean> {

private final Component component;

VisibilityModel (Component component) {
this.component = component;
}

@Override
public Boolean getObject () {
return component.isVisible();
}

@Override
public void setObject (Boolean object) {
component.setVisible(object);
}
}

Will the Component be serialized again with the model, or will wicket only
hold a reference to the already serialized instance of the component?

Thank you in advance

Reply via email to