Class AddressableTablePagingBean

java.lang.Object
com.webmethods.caf.faces.bean.web.AddressableTablePagingBean

public class AddressableTablePagingBean extends Object
Helper bean for implementing addressable table paging.

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 Details

    • m_first

      protected Integer m_first
    • m_rows

      protected Integer m_rows
    • m_sort

      protected ISortInfo m_sort
    • m_firstRequestParam

      protected String m_firstRequestParam
    • m_rowsRequestParam

      protected String m_rowsRequestParam
    • m_sortRequestParam

      protected String m_sortRequestParam
    • m_firstDefaultValue

      protected int m_firstDefaultValue
    • m_rowsDefaultValue

      protected int m_rowsDefaultValue
    • m_sortDefaultValue

      protected String 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 the firstRequestParam property. If "first" request param not present (or not an integer), defaults to the value of the firstDefaultValue 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 the rowsRequestParam property. If "rows" request param not present (or not an integer), defaults to the value of the rowsDefaultValue property.
    • getSort

      public ISortInfo getSort()
      ISortInfo value of "sort" request param (columns to sort). The name of the "sort" request param must be specified by the sortRequestParam property. If "sort" request param not present (or not parsable to an ISortInfo), defaults to the value of the sortDefaultValue property.
    • getFirstRequestParam

      public String getFirstRequestParam()
      Name of the "first" request parameter.
    • setFirstRequestParam

      public void setFirstRequestParam(String firstRequestParam)
      Name of the "first" request parameter.
    • getRowsRequestParam

      public String getRowsRequestParam()
      Name of the "rows" request parameter.
    • setRowsRequestParam

      public void setRowsRequestParam(String rowsRequestParam)
      Name of the "rows" request parameter.
    • getSortRequestParam

      public String getSortRequestParam()
      Name of the "sort" request parameter.
    • setSortRequestParam

      public void setSortRequestParam(String sortRequestParam)
      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

      public String 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

      public void setSortDefaultValue(String sortDefaultValue)
      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".