我使用数据控件从pojo创建af:tree。 java类具有要显示为树的叶节点的子列表。 我能够显示树,但是访问器,它只是java类中列表的名称,也会显示在树中。
我尝试使用以下方法隐藏列表访问者名称,但这会隐藏树中的所有节点/叶子
public void checkIfNodeisAccessor(){
RichTree tree = this.getOrderTree();
JUCtrlHierNodeBinding rootNode = null;
if (tree != null) {
CollectionModel model = (CollectionModel)tree.getValue();
JUCtrlHierBinding treeBinding =
(JUCtrlHierBinding)model.getWrappedData();
rootNode = treeBinding.getRootNodeBinding();
}
getAllHierarichalRowsCount(rootNode);
}
private void getAllHierarichalRowsCount(JUCtrlHierNodeBinding nodeBinding){
Boolean val = null;
if (nodeBinding != null) {
val = nodeBinding.isAccessorFolderNode();
//Pass the row and get all the child rows
if (nodeBinding.hasChildren() &&
nodeBinding.getChildren() != null) {
int chlidRowsCount = nodeBinding.getChildren().size();
for (int i = 0; i < chlidRowsCount; i++) {
JUCtrlHierNodeBinding childNodeBinding =
(JUCtrlHierNodeBinding)nodeBinding.getChildren().get(i);
val = childNodeBinding.isAccessorFolderNode();
// String val = nodeBinding.getLabel();
setRenderValue(!val);
getAllHierarichalRowsCount(childNodeBinding);
}
}
}
}
以下是我的JSPX代码:
<af:tree value="#{bindings.orderList1.treeModel}" var="node"
selectionListener="#{bindings.orderList1.treeModel.makeCurrent}"
rowSelection="single" id="t2" clientComponent="true"
binding="#{backingBeanScope.PortalBean.orderTree}">
<f:facet name="nodeStamp">
<af:group id="g1">
<af:commandLink text="#{node}" id="cl1"
actionListener="{backingbeanscope.portalbean.fetchchildnodes}"
clientComponent="true"
rendered="#{backingBeanScope.PortalBean.renderValue}"/>
</af:group>
</f:facet>
</af:tree>
任何人都可以提供隐藏UI中的访问者名称的任何指示