0

I used data table (OpenFaces) for selecting a row in data table using the attribute o:checkboxColumn rowDatas this will filter the selected rows only.

<o:checkboxColumn rowDatas="#{tBean.srInventoryList}">
    <f:facet name="header">
        <o:selectAllCheckbox />
    </f:facet>
</o:checkboxColumn>

When I click a button it displays all the list, but I want only other rows which are not selected whether any attributes for filter the row list.

Sankar
  • 131
  • 1
  • 2
  • 11

1 Answers1

0

Actually it's not possible by the API of checkboxColumn by itself, You need to add some additional logic inside your bean for example:

<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"/>

End something like this in your backing 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);
}