| wicket.markup.html.panel.Panel wicket.extensions.markup.html.repeater.data.table.DataTable
All known Subclasses: wicket.extensions.ajax.markup.html.repeater.data.table.AjaxFallbackDefaultDataTable, wicket.extensions.markup.html.repeater.data.table.DefaultDataTable,
DataTable | public class DataTable extends Panel implements IPageable(Code) | | A data table builds on data grid view to introduce toolbars. Toolbars can be
used to display sortable column headers, paging information, filter controls,
and other information.
Data table also provides its own markup for an html table so the user does
not need to provide it himself. This makes it very simple to add a datatable
to the markup, however, some flexibility.
Example
<table wicket:id="datatable"></table>
And the related Java code: ( the first column will be sortable because its
sort property is specified, the second column will not )
IColumn[] columns = new IColumn[2];
columns[0] = new PropertyColumn(new Model("First Name"), "name.first", "name.first");
columns[1] = new PropertyColumn(new Model("Last Name"), "name.last");
DataTable table = new DataTable("datatable", columns, new UserProvider(), 10);
table.add(new NavigationToolbar(table));
table.add(new HeadersToolbar(table));
add(table);
See Also: DefaultDataTable author: Igor Vaynberg (ivaynberg) |
TOOLBAR_COMPONENT_ID | final public static String TOOLBAR_COMPONENT_ID(Code) | | The component id that toolbars must be created with in order to be added
to the data table
|
DataTable | public DataTable(String id, IColumn[] columns, IDataProvider dataProvider, int rowsPerPage)(Code) | | Constructor
Parameters: id - component id Parameters: columns - list of IColumn objects Parameters: dataProvider - imodel for data provider Parameters: rowsPerPage - number of rows per page |
addBottomToolbar | public void addBottomToolbar(AbstractToolbar toolbar)(Code) | | Adds a toolbar to the datatable that will be displayed after the data
Parameters: toolbar - toolbar to be added See Also: AbstractToolbar |
addTopToolbar | public void addTopToolbar(AbstractToolbar toolbar)(Code) | | Adds a toolbar to the datatable that will be displayed before the data
Parameters: toolbar - toolbar to be added See Also: AbstractToolbar |
getColumns | final public IColumn[] getColumns()(Code) | | array of column objects this table displays |
getRowCount | final public int getRowCount()(Code) | | total number of rows in this table |
getRowsPerPage | final public int getRowsPerPage()(Code) | | number of rows per page |
newCellItem | protected Item newCellItem(String id, int index, IModel model)(Code) | | Factory method for Item container that represents a cell in the
underlying DataGridView
See Also: Item Parameters: id - component id for the new data item Parameters: index - the index of the new data item Parameters: model - the model for the new data item DataItem created DataItem |
newRowItem | protected Item newRowItem(String id, int index, IModel model)(Code) | | Factory method for Item container that represents a row in the underlying
DataGridView
See Also: Item Parameters: id - component id for the new data item Parameters: index - the index of the new data item Parameters: model - the model for the new data item. DataItem created DataItem |
onPageChanged | protected void onPageChanged()(Code) | | Event listener for page-changed event
|
setRowsPerPage | public void setRowsPerPage(int items)(Code) | | Sets the number of items to be displayed per page
Parameters: items - number of items to display per page |
|
|