Class ManySelectionTrackingListDataModel<T>

java.lang.Object
jakarta.faces.model.DataModel<E>
jakarta.faces.model.ListDataModel<T>
org.springframework.faces.model.SerializableListDataModel<T>
org.springframework.faces.model.ManySelectionTrackingListDataModel<T>
All Implemented Interfaces:
Serializable, Iterable<T>, SelectionAware<T>

public class ManySelectionTrackingListDataModel<T> extends SerializableListDataModel<T> implements SelectionAware<T>
A DataModel implementation that tracks the currently selected rows, allowing any number of rows to be selected at one time.
Author:
Jeremy Grelle
See Also:
  • Constructor Details

    • ManySelectionTrackingListDataModel

      public ManySelectionTrackingListDataModel()
    • ManySelectionTrackingListDataModel

      public ManySelectionTrackingListDataModel(List<T> list)
  • Method Details

    • getSelections

      public List<T> getSelections()
      Description copied from interface: SelectionAware
      Returns the list of selected row data objects for the model.
      Specified by:
      getSelections in interface SelectionAware<T>
      Returns:
      the list of selected row data objects
    • isCurrentRowSelected

      public boolean isCurrentRowSelected()
      Description copied from interface: SelectionAware
      Checks whether the row pointed to by the model's current index is selected.
      Specified by:
      isCurrentRowSelected in interface SelectionAware<T>
      Returns:
      true if the current row data object is selected
    • selectAll

      public void selectAll()
      Description copied from interface: SelectionAware
      Selects all row data objects in the model.
      Specified by:
      selectAll in interface SelectionAware<T>
    • setCurrentRowSelected

      public void setCurrentRowSelected(boolean rowSelected)
      Description copied from interface: SelectionAware
      Sets whether the row pointed to by the model's current index is selected
      Specified by:
      setCurrentRowSelected in interface SelectionAware<T>
      Parameters:
      rowSelected - true to select the current row
    • setSelections

      public void setSelections(List<T> selections)
      Description copied from interface: SelectionAware
      Sets the list of selected row data objects for the model.
      Specified by:
      setSelections in interface SelectionAware<T>
      Parameters:
      selections - the list of selected row data objects
    • select

      public void select(T rowData)
      Description copied from interface: SelectionAware
      Selects the given row data object in the model.
      Specified by:
      select in interface SelectionAware<T>
      Parameters:
      rowData - the row data object to select.