If we knew that a IModel always had one real data object then we should only serialize that one
so instead of doing this:
f (cloneModel)
{
model.detach();
originalModel = (IModel)Objects.clone(model);
}
this:
if (cloneModel)
{
model.detach();
originalObject = Objects.clone(model.getRealSerializeableObject());
}
Then those horrible anonymous or non static innerclasses are not a problem.
But i don't think we can do that because models could ofcourse have more fields then only one object.
johan
On 11/3/05, Igor Vaynberg <[EMAIL PROTECTED]> wrote:
when you serialize from top to the bottom of the hierarchy only one instance is used.
ie. if you serialize the page both your models will point ot the same page instance, but if you serialize the models indivudally, they will each have a separate page instance. so if you call setModelObject and your component is versioned, the model - since its anonymous - will serialize the page and take up a lot of space. better use an inner static class.
-Igor
On 11/2/05, Phil Kulak <[EMAIL PROTECTED] > wrote:Let's say I have this code on a page:
add(new Label("label1", new Model() {
public Object getObject(Component c) {
// Return some interesting string...
}
});
add(new Label("label2", new Model() {
public Object getObject(Component c) {
// Return some other interesting string...
}
});
will the page be serialized into two sperate bytestreams? And if
that's the case, when the page is recreated, will each model be
looking at a different page instance?
-------------------------------------------------------
SF.Net email is sponsored by:
Tame your development challenges with Apache's Geronimo App Server. Download
it for free - -and be entered to win a 42" plasma tv or your very own
Sony(tm)PSP. Click here to play: http://sourceforge.net/geronimo.php
_______________________________________________
Wicket-user mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/wicket-user
