From: Linu H. <lin...@ya...> - 2008-10-01 06:32:00
|
Hello I am having some troubles with the graphic appearence of a tree. Each node is populated by a list When trying to add a new node from a menu command, i add an Object to a list and also i fire an event. Then i add the refresh element to the tree ,and add an event to be aware, like here <tree root="getTreeRoot" guiId="tree" refresh="{eSwitch}"> <node value="'Root'" contentType="Root" onSelect="actionSelectRoot(?item)" children="getChildrenOfRoot(?item)" /> ... <node value="?item.getNodeText" contentType="Project" onSelect="actionSelectPrj(?item)" children="?item.getChildren" /> ... </tree> >From the menu i call the newPrj function of the controller like this <menuBar guiId="menuBar"> <menu text="'File'"> <menu text="'New'"> <menuItem text = "'Project'" actionCommand = "newPrj"></menuItem> and newPrj function triggers an event after adding another element to the project list public void addPrj() { Project p = new Project("New Project"); prjList.add(p); p.setChildren(prjList); eSwitch.fireEvent(); } I can see the list is added a new element,but no graphic node is "drawn" in the tree, even if i call refresh attribute of the tree. What do i do wrong? Thank you |