Class LazyDataModel<T>

    • Constructor Detail

      • LazyDataModel

        public LazyDataModel()
        For serialization only
      • LazyDataModel

        public LazyDataModel​(javax.faces.convert.Converter converter)
        This constructor allows to skip the implementation of getRowData(java.lang.String) and getRowKey(java.lang.Object), when selection is used.
        Parameters:
        converter - The converter used to convert rowKey to rowData and vice versa.
    • Method Detail

      • count

        public abstract int count​(Map<String,​FilterMeta> filterBy)
        Counts the all available data for the given filters. In case of SQL, this would execute a "SELECT COUNT ... WHERE ...". In case you dont use SQL and receive both rowCount and data within a single call, this method should just return 0. You must call recalculateFirst(int, int, int) and setRowCount(int) in your load(int, int, java.util.Map, java.util.Map) method.
        Parameters:
        filterBy - a map with all filter information (only relevant for DataTable, not for eg DataView)
        Returns:
        the data count
      • load

        public abstract List<T> load​(int first,
                                     int pageSize,
                                     Map<String,​SortMeta> sortBy,
                                     Map<String,​FilterMeta> filterBy)
        Loads the data for the given parameters.
        Parameters:
        first - the first entry
        pageSize - the page size
        sortBy - a map with all sort information (only relevant for DataTable, not for eg DataView)
        filterBy - a map with all filter information (only relevant for DataTable, not for eg DataView)
        Returns:
        the data
      • isRowAvailable

        public boolean isRowAvailable()
        Overrides:
        isRowAvailable in class javax.faces.model.ListDataModel<T>
      • getRowData

        public T getRowData()
        Overrides:
        getRowData in class javax.faces.model.ListDataModel<T>
      • getWrappedData

        public List<T> getWrappedData()
        Overrides:
        getWrappedData in class javax.faces.model.ListDataModel<T>
      • setWrappedData

        public void setWrappedData​(Object list)
        Overrides:
        setWrappedData in class javax.faces.model.ListDataModel<T>
      • getRowIndex

        public int getRowIndex()
        Overrides:
        getRowIndex in class javax.faces.model.ListDataModel<T>
      • setRowIndex

        public void setRowIndex​(int rowIndex)
        Overrides:
        setRowIndex in class javax.faces.model.ListDataModel<T>
      • iterator

        public Iterator<T> iterator()
        Specified by:
        iterator in interface Iterable<T>
        Overrides:
        iterator in class javax.faces.model.DataModel<T>
      • getRowCount

        public int getRowCount()
        Overrides:
        getRowCount in class javax.faces.model.ListDataModel<T>
      • getPageSize

        public int getPageSize()
      • setPageSize

        public void setPageSize​(int pageSize)
      • setRowCount

        public void setRowCount​(int rowCount)
      • getConverter

        public javax.faces.convert.Converter getConverter()
      • setConverter

        public void setConverter​(javax.faces.convert.Converter converter)