Hi. I'm having this weird problem with TreePanels. When I run the
following code:
public class Example implements EntryPoint {
public void onModuleLoad() {
final TreePanel tp = new TreePanel();
tp.setRootNode(new TreeNode("Root node that I do NOT wish to be
visible"));
tp.setRootVisible(false);
final TreeNode child = new TreeNode(
"Child nodes like this are not displayed when
appended once
again");
child.addListener(new TreeNodeListenerAdapter() {
public void onClick(Node node, EventObject e) {
tp.getRootNode().removeChild(child);
tp.getRootNode().appendChild(child);
tp.getRootNode().expand(true, true);
}
});
tp.getRootNode().appendChild(child);
new Viewport(tp);
}
}
if I click on the child node, the node itself should be removed then
appended once again to the same root node, right? Well, this isn't
working UNLESS I setRootVisible(true) in which case the child node is
re-appended correctly.
If I append child.cloneNode() instead of the child itself, it does
work. But this is no use to me, as my application needs to append and
remove entire subtrees during its execution, and cloneNode() does not
clone the whole tree. Besides, I do not want duplicates lying around,
nor do I want the root node to be visible.
What's weird is that, when I query the root node for its children, it
does appear to have one child.
Tested with GWT-Ext 2.0.4, Ext-2.0.2 and GWT 1.5 RC2 on both Firefox 2
and 3, as well as the GWT hosted mode browser.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"GWT-Ext Developer Forum" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/gwt-ext?hl=en
-~----------~----~----~----~------~----~------~--~---