Jsf ADF树中的公开节点

Jsf ADF树中的公开节点,jsf,tree,oracle-adf,Jsf,Tree,Oracle Adf,我正在jsff页面中使用af:tree ADF组件。af:树中使用的模型是这样一个类(该类不基于ViewObject): 公共类树项{ 字符串描述; 列出儿童名单; } 如何披露仅与某些描述匹配的节点?在web上,我只找到了基于ViewObject的af:tree模型的示例。披露树节点取决于树组件本身,而不是它的模型,如果您想以编程方式披露它,请参考哪种解释,确切地说,看起来您没有使用ADF BC。您必须管理树表的ExposedRowKey,然后在RowExposureListener的处理程

我正在jsff页面中使用af:tree ADF组件。af:树中使用的模型是这样一个类(该类不基于ViewObject):

公共类树项{
字符串描述;
列出儿童名单;
}

如何披露仅与某些描述匹配的节点?在web上,我只找到了基于ViewObject的af:tree模型的示例。

披露树节点取决于树组件本身,而不是它的模型,如果您想以编程方式披露它,请参考哪种解释,确切地说,

看起来您没有使用ADF BC。您必须管理树表的ExposedRowKey,然后在RowExposureListener的处理程序中,您可以根据描述是否符合要求来更新ExposedRowKey。disclosedRowKeys的内容是RowKeySet的实例

<af:treeTable disclosedRowKeys="#{myBean.disclosedRowKeys}" 
              rowDisclosureListener="#{myViewBean.handleRowDisclosure}">
</af:treeTable>
在视图bean中:

class MyViewBean{
  public void handleRowDisclosure(RowDisclosureEvent event)
  {
    //get the addedSet OR removedSet - because the event can be expanding or collapsing row.
    //obtain the collection model from the tree table.
    //use the above collection model and the addedSet OR removedSet to get the exact instance of TreeItem.
    if TreeItem.description is satisfied then
      getDisclosedRowKeys from the page model and then add/remove the keys obtained in the addedSet OR removedSet.

    partially refresh the treeTable.
  }
}

我目前无法尝试这种逻辑。但我会在回去工作后尝试一下。

当节点是类TreeItem的实例时,如何设置“#{myBean.disposedrowkeys}”的内容?感谢RowKey的内容是索引,即树表中数据的索引。您可以在我的一篇博客文章中了解更多关于它的信息:所以您的节点是TreeItem类的实例还是其他类并不重要。无论如何,您将使用ChildPropertyTreeModel实例包装TreeItem列表。
class MyPageBean{
  RowKeySet disclosedRowKeys;
  //getters and setters.
}
class MyViewBean{
  public void handleRowDisclosure(RowDisclosureEvent event)
  {
    //get the addedSet OR removedSet - because the event can be expanding or collapsing row.
    //obtain the collection model from the tree table.
    //use the above collection model and the addedSet OR removedSet to get the exact instance of TreeItem.
    if TreeItem.description is satisfied then
      getDisclosedRowKeys from the page model and then add/remove the keys obtained in the addedSet OR removedSet.

    partially refresh the treeTable.
  }
}