Hello, I'm using rich:tree and i want to expand the tree to a specific node.
i used public Boolean adviseNodeOpened(UITree tree) method, but it does not work!
this is my method, what's wrong?
public void nodeSelectListener(NodeSelectedEvent event) { try { UITree tree = (UITree)event.getComponent(); selectedNode = tree.getTreeNode(); rowKeySelected = (TreeRowKey) tree.getRowKey(); tree.queueNodeExpand(rowKeySelected); } catch (IOException e) { System.out.println("Exception ici "+e.getMessage()); } } public Boolean adviseNodeOpened(UITree tree) { if(rowKeySelected !=null) { try { tree.queueNodeExpand(rowKeySelected); return Boolean.TRUE; } catch (IOException e) { System.out.println("Exception ici "+e.getMessage()); } } return null; }
I used a similar code as your nodeSelectListener, but didn't use the adviseNodeOpened method and it's working.
You specified the nodeSelectListener for the component, right?
<rich:tree nodeSelectListener="#{yourBean.nodeSelectListener}"
...
Joel