I'm attempting to accomplish the same thing, and am actually maintaining the
model in the user's session.  When I need to have two panels on the page
which show a different piece of the same model, I actually pass in the same
model.  To handle Ajax updating of both panels, I call a method on the model
and pass in the component that initiated the change, and then walk the page
hierarchy looking for anyone who cares that the model changed so they can
add themselves to the AjaxRequestTarget.

See:
http://www.nabble.com/Updating-distant-%28unrelated%29-components-via-Ajax-when-a-shared-model-changes-tf4610276.html

The resulting programming model feels a lot like Swing, in that I can set
something in a high level at the model and have all related components
repaint, but it's still using the pull model of Wicket.  The code I posted
in the referenced thread basically accomplishes what is handled for you in
Swing, which is having the framework repaint the widgets for you without
having to explicitly look them up and say 'repaint yourself'.  Does anyone
have any thoughts on whether this will work long-term in Wicket?

Thanks,
Matt


Newgro wrote:
> 
> Maybe im a bit swing-oriented. There we don't create always new page and
> panel 
> instances. Instead we reuse the created view instances and exchange simply 
> the model / models. So if (as an example) i change the order (while 
> navigating thru all orders) the related adress will change to.
> So i could always create the whole page for the new order again or
> exchange 
> the model.
> 
> Thanks
> Per
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
> 
> 
> 

-- 
View this message in context: 
http://www.nabble.com/HOWTO---update-models-in-chain-%28push-or-pull%29-tf4612233.html#a13191539
Sent from the Wicket - User mailing list archive at Nabble.com.


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

Reply via email to