Hi, On Nov 27, 2007 12:42 PM, Thomas Krause <[EMAIL PROTECTED]> wrote: > Hello, > > thank you very much for that hint. Since I want to update the tree as > often as possible at every user interaction and I don't want to add a > call to updateNotes() at every possible link or button I will try > detect wether the rendering was forced by an action on the tree or by > something else. Should'nt be a problem since I have the callback > functions.
What does it mean "update tree as often as possible"? The only thing you have to do when adding/removing node is to invoke the proper listener callbacks, thus you should be using methods in DefaultTreeModel (insertNodeInto, removeNodeFromParent, etc.). If you modify the tree using these methods DefaultTreeModel makes sure the proper listener callbacks are invoked and the tree is notified about the changes and updates itself properly. -Matej > > Again, thank you very much I think I got it now :-) > > > Greetings > > Thomas > > 2007/11/27, Matej Knopp <[EMAIL PROTECTED]>: > > Hi, > > > > problem is that you rebuild the entire tree in onBeforeRender(). > > onBeforeRender is invoked on every render, even when you > > expand/collapse a node. So you collapse a node but right afterwards > > you rebuild the entire tree, that's why you don't see the node being > > collapsed. > > > > Try moving the updateNodes() call to link's onClick(). > > > > -Matej > > > > On Nov 27, 2007 10:12 AM, Thomas Krause <[EMAIL PROTECTED]> wrote: > > > Hello again, > > > > > > I tried to create an as simple as possible example quick start (I hope > > > this is what you meant). The original code already would have been too > > > bloated: > > > > > > http://www2.informatik.hu-berlin.de/~krause/examples/BaseTreeProblemQuickstart.zip > > > > > > Hopefully somebody sees where my fault is because I have the feeling > > > that even working since quite a long time with Wicket I didn't > > > understand some very basic stuff and that's why it is failing. > > > > > > Greetings > > > > > > Thomas > > > > > > 2007/11/27, Matej Knopp <[EMAIL PROTECTED]>: > > > > > > > It's hard to tell without any code. Basically, if you have proper > > > > listeners fired in your model the tree should update itself. > > > > Alternatively, you can try calling invalidateAll() in your page > > > > onBeforeRender() (before calling super.onBeforeRender). > > > > > > > > Can you post a quickstart? > > > > > > > > -Matej > > > > > > > > On Nov 26, 2007 6:33 PM, Thomas Krause <[EMAIL PROTECTED]> wrote: > > > > > Hello, > > > > > > > > > > since a few days I'm struggling with a problem I didn't find any > > > > > solution yet. > > > > > > > > > > I have two pages containing some Panels and a BaseTree (I'm using my > > > > > own node panel) each. setLinkType(BaseTree.LinkType.REGULAR) is used. > > > > > What I want is that the tree is updated every time the page is updated > > > > > due to some actions done by the user. This works correctly for page > > > > > number one but not for the other one. Page 2 shows the updated tree > > > > > (all nodes are expanded) but there is no visual feedback when a node > > > > > is selected even if the selection on "the code side" works. It is not > > > > > possible for the user to collapse a node as well. > > > > > > > > > > I have some questions related with the problem. Before I forget to > > > > > mention it: I use 1.3.0 RC1. > > > > > > > > > > 1) Is it OK using onBeforeRender() (overridden at the page, super is > > > > > called *after* I updated everything) to update the model of the tree? > > > > > > > > > > 2) Should I update the model of the tree by removing and adding nodes > > > > > to the root-node and then calling reload() on the DefaultTreeModel? > > > > > The more I think about it I would say "no" since this is a method from > > > > > the Swing-API. But it works on page 1 (would't work if it is not > > > > > there). Calling updateTree() on the AbstractTree has no effect since i > > > > > don't use AJAX. > > > > > > > > > > If you need any code or more explanation I will provide it of course. > > > > > I hope somebody has an idea what I'm doing wrong. > > > > > > > > > > Thank you for your help. > > > > > > > > > > Thomas Krause > > > > > > > > > > --------------------------------------------------------------------- > > > > > 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] > > > > > > > > > > > > > > --------------------------------------------------------------------- > > > 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] > > > > > > --------------------------------------------------------------------- > 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]
