HELP - expandir nó do componente

0 respostas
I

Pessoal, estou utilizando o Tree do richfaces (+jsf, + Seam) … depois de muito pesquisar consegui montar a arvore, porém ainda não consegui expandir o nó da mesma.

Apesar de ter encontrado alguns exemplos na net, ainda não consegui implementar , irei continuar pesquisando, mais se alguem puder me ajudar fico grata, pois meu prazo esta acabando - rsrsrs

abaixo o código …

XHTML:
<a4j:outputPanel id=“tree1” rendered=“true” ajaxRendered=“true”>
<rich:tree rendered=“true” id=“tree” value="#{dsaManager.root}"
nodeSelectListener="#{dsaManager.selectionListener}"
ajaxSubmitSelection=“true”>
</rich:tree>
</a4j:outputPanel>

CLASSE:

private TreeNode<String> root = new TreeNodeImpl<String>();
private static int id = 0;

public DashboardStateActionsManager() {
	final int FIVE = 5;
    TreeNodeImpl<String> temp;
    for (; id < FIVE; id++) {
        temp = new TreeNodeImpl<String>();
        temp.setData("Node #" + id);
        root.addChild(id, temp);
    }

  }

@SuppressWarnings("unchecked")
public void selectionListener(NodeSelectedEvent event) {
    UITree selected = (UITree) event.getComponent();
    TreeNodeImpl<String> selectedNode = (TreeNodeImpl<String>) selected
            .getModelTreeNode();
    TreeNodeImpl<String> child = new TreeNodeImpl<String>();
    child.setData("hello");
    selectedNode.addChild(id++, child);        
 
}

public TreeNode<String> getRoot() {
        return root;
}

public void setRoot(TreeNode<String> root) {
        this.root = root;
}
Criado 29 de outubro de 2009
Respostas 0
Participantes 1