Hi,

I have implemented such model (as Johan wrote) in our application. It uses observer pattern and it has methods like: addListener, removeListener and notify(Event event) (Event is an enum). Each panel register itself as a proper "events" listener and in onClick() you can simply call model.notify(Event.SOME_EVENT) to fire listener methods in other panels.

Daniel

On 2008-02-05, at 23:51, Johan Compagner wrote:

What not do that in your model itself? (Observer pattern or something like
that)
Just like all the swing models do because of there push nature instead of
pull




On Feb 5, 2008 11:05 AM, Gabor Szokoli <[EMAIL PROTECTED]> wrote:

Hi!

We are trying to build our application from loosely coupled panels,
sharing models here and there as needed.
It works wounderfully 90% of the time: as long as the panels contain
wicket components only, and no further UI logic. One panel can update
a model, and the data is reflected in the components of the other
panel, as it should.

But sometimes one panel needs to perform an action when its model
object is changed from an onClick handler on another panel.
OnModelChanged is not called, because the other panel has no direct
reference to this panel to perform a setObject on it, they only share
a model, and do setObject on that.

Where do I put my OnModelObjectChanged event handling code without
sacrificing too much from my lovely loosely coupling?

Any advice is warmly welcome.


Gabor Szokoli

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




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

Reply via email to