Tenho uma árvore do RichFaces e gostaria que quando carregasse, abrisse a página com a tree, o primeiro nó ja estivesse expandido. Alguém tem alguma idéia? ou como faz, qual tag usar, algo do tipo.
Obrigado.
consegui com:
no meu controller da arvore:
[code]public Boolean adviseNodeOpened(UITree tree) {
if (!AuthorizationListener.isPostback()) {
Object key = tree.getRowKey();
TreeRowKey treeRowKey = (TreeRowKey) key;
if (treeRowKey == null || treeRowKey.depth() <= 1) {
return Boolean.TRUE;
}
}
return null;
}[/code]
tenho uma classe implementando PhaseListener e possui:
[code]public static boolean isPostback() {
FacesContext facesContext = FacesContext.getCurrentInstance();
if (facesContext != null) {
ExternalContext externalContext = facesContext.getExternalContext();
if (externalContext != null) {
return Boolean.TRUE.equals(
externalContext.getRequestMap().get(POSTBACK_ATTRIBUTE_NAME));
}
}
return false;
}[/code]
o método da arvore, onde tem treeRowKey.depth() <= 1, 1 é o numero de expansões.
adviseNodeOpened="#{arvoreListagem.adviseNodeOpened}"
a tag da tree.
obrigado.