Class AddressableTablePagingBean
Set the value of this bean's firstRequestParam
property to match
the value of the table control's firstRequestParam
property
(which is the name of the request parameter that specifies the index of the first row to display);
set the value of this bean's rowsRequestParam
property to match
the value of the table control's rowsRequestParam
property
(which is the name of the request paramater that specifies number of rows to display);
and set the value of this bean's sortRequestParam
property to match
the value fo the table conrol's sortRequestParam
property
(which is the name of the request parameter that specifies the columns to sort).
Optionally set the value of this bean's firstDefaultValue
property
to the index of the first row to display by default (defaults to 0);
optionally set the value of this bean's rowsDefaultValue
property
to the number of rows to display by default (defaults to 0 -- indicating all rows);
and optionally set the value of this bean's sortDefaultValue
property
to the ids of the columns to sort by default (defaults to null -- indicating don't sort).
For example, to by default sort by the column with an id of "author" (ascending)
and then the column with an id of "pubDate" (descending),
set the value of this bean's sortDefaultValue
property to "author+,pubDate-".
Finally, bind the table control's first
property
to this bean's first
property (via binding expression);
bind the table controls's rows
property
to this bean's rows
property (via binding expression);
and bind the ordinal
and ascending
properties of each sortable column
to a value in the ordinals
and ascendings
providers
of this bean's sort
property (via binding expression).
For example, for a column with an id of "author" (assuming this bean is available
as the tablePaging
property of the active page bean),
bind the column's ordinal
property to "#{activePageBean.tablePaging.sort.ordinals['author']}",
and bind the column's ascending
property to "#{activePageBean.tablePaging.sort.ascendings['author']}".
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionint
getFirst()
Integer value of "first" request param (zero-based index of first row to display).int
Zero-based index of first row to display, by default.Name of the "first" request parameter.int
getRows()
Integer value of "rows" request param (number of rows to display; less than 1 indicates display all).int
Number of rows to display, by default.Name of the "rows" request parameter.getSort()
ISortInfo
value of "sort" request param (columns to sort).Columns to sort, by default.Name of the "sort" request parameter.void
setFirstDefaultValue
(int firstDefaultValue) Zero-based index of first row to display, by default.void
setFirstRequestParam
(String firstRequestParam) Name of the "first" request parameter.void
setRowsDefaultValue
(int rowsDefaultValue) Number of rows to display, by default.void
setRowsRequestParam
(String rowsRequestParam) Name of the "rows" request parameter.void
setSortDefaultValue
(String sortDefaultValue) Columns to sort, by default.void
setSortRequestParam
(String sortRequestParam) Name of the "sort" request parameter.
-
Field Details
-
m_first
-
m_rows
-
m_sort
-
m_firstRequestParam
-
m_rowsRequestParam
-
m_sortRequestParam
-
m_firstDefaultValue
protected int m_firstDefaultValue -
m_rowsDefaultValue
protected int m_rowsDefaultValue -
m_sortDefaultValue
-
-
Constructor Details
-
AddressableTablePagingBean
public AddressableTablePagingBean()
-
-
Method Details
-
getFirst
public int getFirst()Integer value of "first" request param (zero-based index of first row to display). The name of the "first" request param must be specified by thefirstRequestParam
property. If "first" request param not present (or not an integer), defaults to the value of thefirstDefaultValue
property. -
getRows
public int getRows()Integer value of "rows" request param (number of rows to display; less than 1 indicates display all). The name of the "rows" request param must be specified by therowsRequestParam
property. If "rows" request param not present (or not an integer), defaults to the value of therowsDefaultValue
property. -
getSort
-
getFirstRequestParam
Name of the "first" request parameter. -
setFirstRequestParam
Name of the "first" request parameter. -
getRowsRequestParam
Name of the "rows" request parameter. -
setRowsRequestParam
Name of the "rows" request parameter. -
getSortRequestParam
Name of the "sort" request parameter. -
setSortRequestParam
Name of the "sort" request parameter. -
getFirstDefaultValue
public int getFirstDefaultValue()Zero-based index of first row to display, by default. -
setFirstDefaultValue
public void setFirstDefaultValue(int firstDefaultValue) Zero-based index of first row to display, by default. -
getRowsDefaultValue
public int getRowsDefaultValue()Number of rows to display, by default. Less than one indicates display all. -
setRowsDefaultValue
public void setRowsDefaultValue(int rowsDefaultValue) Number of rows to display, by default. Less than one indicates display all. -
getSortDefaultValue
Columns to sort, by default.The format of this string is a cvs (comma-separated values) list of column ids, with either "+" or "-" appended to each column id. The first column id is the column to sort by first, the second column id is the column to sort by second, etc. A "+" following the column id indicates sort the column ascending (a-z, 1-9, past-future, etc.); a "-" following the column id indicates sort the column descending (z-a, 9-1, future-past, etc.).
For example, "" indicates no sort; "author+" indicates sort ascending (a-z) by the column with an id of "author"; "author+,pubDate-" indicates sort ascending (a-z) by the column with an id of "author", then sort descending (future-past) by the column with an id of "pubDate".
-
setSortDefaultValue
Columns to sort, by default.The format of this string is a cvs (comma-separated values) list of column ids, with either "+" or "-" appended to each column id. The first column id is the column to sort by first, the second column id is the column to sort by second, etc. A "+" following the column id indicates sort the column ascending (a-z, 1-9, past-future, etc.); a "-" following the column id indicates sort the column descending (z-a, 9-1, future-past, etc.).
For example, "" indicates no sort; "author+" indicates sort ascending (a-z) by the column with an id of "author"; "author+,pubDate-" indicates sort ascending (a-z) by the column with an id of "author", then sort descending (future-past) by the column with an id of "pubDate".
-