public class AddressableTablePagingBean extends Object
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']}".
Modifier and Type | Field and Description |
---|---|
protected Integer |
m_first |
protected int |
m_firstDefaultValue |
protected String |
m_firstRequestParam |
protected Integer |
m_rows |
protected int |
m_rowsDefaultValue |
protected String |
m_rowsRequestParam |
protected ISortInfo |
m_sort |
protected String |
m_sortDefaultValue |
protected String |
m_sortRequestParam |
Constructor and Description |
---|
AddressableTablePagingBean() |
Modifier and Type | Method and Description |
---|---|
int |
getFirst()
Integer value of "first" request param
(zero-based index of first row to display).
|
int |
getFirstDefaultValue()
Zero-based index of first row to display, by default.
|
String |
getFirstRequestParam()
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 |
getRowsDefaultValue()
Number of rows to display, by default.
|
String |
getRowsRequestParam()
Name of the "rows" request parameter.
|
ISortInfo |
getSort()
ISortInfo value of "sort" request param
(columns to sort). |
String |
getSortDefaultValue()
Columns to sort, by default.
|
String |
getSortRequestParam()
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.
|
protected Integer m_first
protected Integer m_rows
protected ISortInfo m_sort
protected String m_firstRequestParam
protected String m_rowsRequestParam
protected String m_sortRequestParam
protected int m_firstDefaultValue
protected int m_rowsDefaultValue
protected String m_sortDefaultValue
public int getFirst()
firstRequestParam
property.
If "first" request param not present (or not an integer),
defaults to the value of the firstDefaultValue
property.public int getRows()
rowsRequestParam
property.
If "rows" request param not present (or not an integer),
defaults to the value of the rowsDefaultValue
property.public ISortInfo getSort()
public String getFirstRequestParam()
public void setFirstRequestParam(String firstRequestParam)
public String getRowsRequestParam()
public void setRowsRequestParam(String rowsRequestParam)
public String getSortRequestParam()
public void setSortRequestParam(String sortRequestParam)
public int getFirstDefaultValue()
public void setFirstDefaultValue(int firstDefaultValue)
public int getRowsDefaultValue()
public void setRowsDefaultValue(int rowsDefaultValue)
public String getSortDefaultValue()
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".
public void setSortDefaultValue(String sortDefaultValue)
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".