通过Javascript扩展JSF树

通过Javascript扩展JSF树,javascript,jsf,tree,jsf-2,trinidad,Javascript,Jsf,Tree,Jsf 2,Trinidad,我有一棵实用的特立尼达树。我想在加载页面时展开树 <tr:tree id="treeid" value="#{backingbean.model}" var="model"> ... </tr:tree> 虽然JS函数被触发,但它不会展开树。我认为我不应该对树节点使用click()。你知道怎么做吗……我是这样解决的: 在您的BackingBean中: public class BackingBean { RowKeySetImpl rowKeySet =

我有一棵实用的特立尼达树。我想在加载页面时展开树

<tr:tree id="treeid"  value="#{backingbean.model}" var="model">
...
</tr:tree>
虽然JS函数被触发,但它不会展开树。我认为我不应该对树节点使用click()。你知道怎么做吗……

我是这样解决的:

在您的BackingBean中:

 public class BackingBean
 {
     RowKeySetImpl rowKeySet = new RowKeySetImpl();
     public BackingBean()
     { 
        super();
        rowKeySet.addAll();
     }

     public RowKeySetImpl getRowKeySet() {
       return rowKeySet;
       }

     public void setRowKeySet(RowKeySetImpl rowKeySet) {
       this.rowKeySet = rowKeySet;
       }
 }
在您的页面中:

 <tr:tree id="treeid" var="model" value="#{backingBean.model}" disclosedRowKeys="#{backingBean.rowKeySet}">

感谢您的回复,不过我已经用类似的方法解决了问题。
 <tr:tree id="treeid" var="model" value="#{backingBean.model}" disclosedRowKeys="#{backingBean.rowKeySet}">