嗨,我有一个变量
List<List<MyObject>> x = new ArrayList<List<MyObject>>();
我希望这个绑定到 jsf 中包含 select 的数据表
<datatable>
<column>
<Select/>
</column>
</datatable>
这在jsf中可能吗
代码:view.xhtml
<h:dataTable id="i1" value="#{bean.listoflist}" var="list1">
<h:column>
<h:selectOneListbox value="#{bean.somestring}" >
<f:selectItems value="#{list1.?}" var="any" itemValue="#{any.??}/>"
</h:selectOneListbox>
</h:column>
</h:dataTable>`
Bean.java (name = "bean")
public class Bean implements Serializable
{
List<List<MyObject>> listoflist = new ArrayList<List<MyObject>>()
//--------------Getters and Setter
}
MyObject.java
public class MyObject
{
private String s1;
private String s2;
//---------------getter and setter
}