我使用属性o:checkboxColumn rowDatas在数据表(OpenFaces)中选择了一行,这将只过滤选中的行。
<o:checkboxColumn rowDatas="#{tBean.srInventoryList}">
<f:facet name="header">
<o:selectAllCheckbox />
</f:facet>
</o:checkboxColumn>当我点击一个按钮时,它会显示所有的列表,但我只想要其他没有被选中的行,无论是否有任何属性用于筛选行列表。
发布于 2013-05-30 19:20:18
实际上,单靠checkboxColumn的应用程序接口是不可能的,你需要在你的bean中添加一些额外的逻辑,例如:
<o:dataTable id="bookMultipleSelection"
var="book"
value="#{BookList.books}">
<o:multipleRowSelection rowDatas="#{BookList.list}"/>
<o:selectionColumn>
<f:facet name="header">
<o:selectAllCheckbox/>
</f:facet>
</o:selectionColumn>
/**other columns here**/
</o:dataTable>
<o:commandButton execute="bookMultipleSelection" action="#{BookList.updateList}" render="bookMultipleSelection" value="Click ME"/>在你的支持bean中结束类似这样的事情:
private List<Book> books;
private List list = new ArrayList();
public List getList() {
return list;
}
public void setList(List list) {
this.list = list;
}
public List<Book> getBooks() {
return books;
}
public void updateList(){
books.removeAll(list);
}https://stackoverflow.com/questions/16808531
复制相似问题