Do you replace the model or change the content of the model?

replace model is:

componentA.setModel(new Model(...));

change model:

componentA.setModelObject(...);

I think when you change it it should work...

Another approach might be to replace component A with a fresh instance,
although I can't judge the impact regarding on its child components....

So:

ComponentA replacement = new ComponentA(YourNewModel);
componentA.replaceWith(replacement);
target.addComponent(replacement);

Lars

On Fri, Apr 11, 2008 at 11:05 AM, Alexis <[EMAIL PROTECTED]> wrote:

>
> Hi list,
>
> here's my little and annoying problem :
> I made a component A that encapsulate a lot of children component (in fact
> it's a tree like component).
> On that component, i attach an AjaxBehavior of my own that respond to an
> ajax callback with :
> - traversing A's children
> - modifying these component's models (after the complete traversing is
> done)
> - add the component A to the AjaxRequestTarget
>
> When A is re-rendered, all the children components reflects their new
> model
> states, this is good. A's Model has changed to, but A doesn't reflect this
> changes.
> I've spent some hours on this and this is what i could find :
> - A's model is read before his behavior responds
> - A's model is not re-read after the behvior responds (when added to the
> target), and contains stale data...
>
> My knowledge on wicket's request-response loop might be too short for this
> one, any ideas ?
>
> Thanks
>
>
> --
> View this message in context:
> http://www.nabble.com/Model-refreshing-and-behaviors-tp16627278p16627278.html
> 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