Timo Rantalaiho wrote:
On Fri, 04 Jul 2008, Matthijs Wensveen wrote:
How do you cope with deeply nested model properties? For example:

public class PersonViewer extends Component<Person> {
..
}

some other component does:
person.getOrders().get(0).setAmount(0); // first order for free (as in beer)

I have no idea of Johan's project, but normally you just edit an object in one place at a time, and PersonViewer would be a read-only component with a model that always pulls the freshest version of the person it is displaying from the database.

Best wishes,
Timo

The thing is that when using Ajax you have to specifically add PersonViewer to the AjaxRequestTarget when 'some other component' modifies the Person object. The problem is that 'some other component' might not even know about or have access to PersonViewer (maybe it's a 3rd-party component). OnModelChanged does not work in this case, because there is no call to setModelObject, just to some setter of the Person object.

While Ajax does very nice things to the GUI, it kinda messes up the model-driven (as in wicket model) approach to gui development. That is why I was thinking about some aspect-oriented solution to let components know about model updates, even when they keep a reference to the same object.

Matthijs

--
Matthijs Wensveen
Func. Internet Integration
W http://www.func.nl
T +31 20 4230000
F +31 20 4223500

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to