richfaces的demo中有關Tree 結點信息顯示的問題

Mrpublic 2009-03-06
HtmlTree 有一個方法getRowData();但它只能顯示當前結點的title,有沒有一個方法顯示從根結點到它的title呀
无双Rama 2009-03-23
1. @Out(required=false)
private String strPath;

2. public void path(TreeNode cr){

MenuItem mi;
mi=(MenuItem)cr.getData();
strPath=mi.getmenuName();
do {
if (cr.getParent()!=null )
strPath=((MenuItem)       cr.getParent().getData()).getmenuName()+">>"+strPath;
cr=cr.getParent();
} while (cr.getParent()!=null);
}


3. @Begin(join = true)
public void processSelection(NodeSelectedEvent event) {
UITree tree = getTree(event);
if (tree != null) {
selectMenuItem = (MenuItem) tree.getTreeNode().getData();
path(tree.getTreeNode());
}
}
4.在页面中这样写<h:outputText value=#{strPath} />
然后这个form 的id 要与 <rich:tree>中的id 一致就OK了
cuixiufang 2009-04-23
Global site tag (gtag.js) - Google Analytics