Hi,
so I've been fighting with this page for quite a bit,
due to a number of different reasons, and I came
to realize there are fundamental problems in the
way it's setup.
Generally speaking, trying to put togheter a
tabbed form in Wicket is source of headaches.
The thing is, each tab has to be a form of its
own, and you have to make modifications to the
way the tabbed panel operates in order to
submit the current page form before switching
to the other, failing to do so makes all modifications
die (this is because on switch the subforms are
not submitted, and thus
Which basically means, when the user switches
the page, the stuff is written inside the layer/resource
info (since so catalog.save is called, actually
the modification proxy is holding the diff).
But it gets funnier. We know that it's bad practice
to keep around a heavy model, and that we should use
a loadable model instead. Well, think about it,
if we do so, the changes are written inside
the modification proxy wrapping the layer/resource,
then the page is serialized and the model is detached,
making the modification proxy go the way of the dodo.
Result: if we play by the book we loose the
edits even if we make the tab submit each subform
on tab switch. Aagh.
What to do? Well, the easy way is to kill the
tabs and have everything in a single looong page.
Longer than it used to be, because now it's nicely
organised in section with tabs, and the form component
labels are placed above each form component.
Alternatively... hmm... I guess the loadable/detachable
model has to detach the actual resource, but somehow
keep around the modification proxies with their
rich load of modified fields.
Or, alternatively, don't play by the book and really
serialize the resource, so that when the other tab
loads, the _same_ object is provided, and so on
when we go back.
All the issue boils down to trying to simulate
a javascripty UI. A ext UI would a full copy of
the resource client side, edit it at will,
and submit it to the server in a single shot.
If we do the same, we're safe, if we don't, bye bye.
But we have to accept serializing the whole baby.
I may try to explore other avenues, but if I fail,
what would you prefer we do?
Thoughts?
Cheers
Andrea
--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.