jani
23 Jun 2009, 1:12 AM
Host mode GXT 2.0 m3
If you expand TridGree node and add an item to it, the node fails to close again.
If you press the button before expanding node - works as expected.
If you expand the node first and the press the button you can't collapse it anymore due to NullPointerException at TreeGrid$TreeNode.access$0(TreeGrid.java:56)
TreePanel works correctly in this scenario.
Quick test for the problem: (modify TreeGridExample.java to add a button)
...
cp.add(tree);
Button addDataButton = new Button();
addDataButton.setText("Add a node");
addDataButton.addSelectionListener(new SelectionListener<ButtonEvent>(){
@Override
public void componentSelected(ButtonEvent ce)
{
List<ModelData> rootItems = store.getRootItems();
ModelData firstRoot = rootItems.get(0);
Music test = new Music("A song that causes trouble", "Test", "Tester");
store.add(firstRoot, test, false);
}});
add(addDataButton);
add(cp);
}
}
If you expand TridGree node and add an item to it, the node fails to close again.
If you press the button before expanding node - works as expected.
If you expand the node first and the press the button you can't collapse it anymore due to NullPointerException at TreeGrid$TreeNode.access$0(TreeGrid.java:56)
TreePanel works correctly in this scenario.
Quick test for the problem: (modify TreeGridExample.java to add a button)
...
cp.add(tree);
Button addDataButton = new Button();
addDataButton.setText("Add a node");
addDataButton.addSelectionListener(new SelectionListener<ButtonEvent>(){
@Override
public void componentSelected(ButtonEvent ce)
{
List<ModelData> rootItems = store.getRootItems();
ModelData firstRoot = rootItems.get(0);
Music test = new Music("A song that causes trouble", "Test", "Tester");
store.add(firstRoot, test, false);
}});
add(addDataButton);
add(cp);
}
}