you can just call A.getmodel().detach() to uncache the model

-igor


On Fri, Apr 11, 2008 at 7:52 AM, Alexis <[EMAIL PROTECTED]> wrote:
>
>  Okay, i've managed to get it working with removing and adding the component
>  to its parent, here's a snippet :
>
>         final ChaptersTreeView treeView = new
>  ChaptersTreeView("activities_tree", loadModel);
>         treeView.add(new SortableTreeAjaxBehavior() {
>             @Override
>             protected void treeModelHasBeenReconstructed(AjaxRequestTarget
>  target) {
>
>  cdtServiceCenter().bookService().dataContext().commitChanges();
>                 treeContainer.remove(treeView); // here's the thing
>                 treeContainer.add(treeView);      //
>                 target.addComponent(treeContainer);
>             }
>         });
>
>  I don't know why but removing and adding the component wakes his model up.
>  Before that i tried to modelChanged(); and all kind of Dr House voodoo...
>  I guess i might have miss something but i'll live with it :)
>
>
>
>  Alexis 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-tp16627278p16627849.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]
>
>

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

Reply via email to