List of usage examples for org.apache.wicket.extensions.markup.html.repeater.data.table DataTable addBottomToolbar
public void addBottomToolbar(final AbstractToolbar toolbar)
From source file:org.ujorm.hotels.gui.customer.CustomerTable.java
License:Apache License
public CustomerTable(String id) { super(id);/*w w w . ja v a 2 s . c o m*/ UjoDataProvider<Customer> columns = UjoDataProvider.of(getCriterion()); columns.add(Customer.LOGIN); columns.add(Customer.TITLE); columns.add(Customer.FIRSTNAME); columns.add(Customer.SURENAME); columns.add(Customer.EMAIL); columns.add(Customer.ADMIN); columns.add(Customer.ACTIVE); columns.add(createActionColumn()); columns.setSort(Customer.LOGIN); add(columns.createDataTable(10)); // Dialogs: add((editDialog = CustomerEditor.create("editDialog", 700, 390)).getModalWindow()); add((removeDialog = MessageDialogPane.create("removeDialog", 290, 160)).getModalWindow()); add((loginDialog = LoginDialog.create("loginDialog", 600, 150)).getModalWindow()); DataTable table = ((DataTable) get(DEFAULT_DATATABLE_ID)); table.addBottomToolbar(new InsertCustomer(table)); }
From source file:org.ujorm.hotels.gui.hotel.HotelTable.java
License:Apache License
public HotelTable(String id) { super(id);// w ww .j a v a 2s. c o m UjoDataProvider<Hotel> columns = UjoDataProvider.of(toolbar.getCriterion()); columns.add(Hotel.NAME); columns.add(Hotel.CITY.add(City.NAME)); // An example of relations columns.add(Hotel.STREET); columns.add(Hotel.PRICE); columns.add(KeyColumn.of(Hotel.CURRENCY, SORTING_OFF)); columns.add(Hotel.STARS); columns.add(Hotel.PHONE); columns.add(newActionColumn()); columns.setSort(Hotel.NAME); add(columns.createDataTable(DEFAULT_DATATABLE_ID, 10)); add(toolbar); add((editDialog = HotelEditor.create("editDialog", 700, 410)).getModalWindow()); add((bookingDialog = BookingEditor.create("bookingDialog", 700, 390)).getModalWindow()); add((removeDialog = MessageDialogPane.create("removeDialog", 290, 160)).getModalWindow()); DataTable table = ((DataTable) get(DEFAULT_DATATABLE_ID)); table.addBottomToolbar(new InsertHotel(table)); columns.setCssClass(Hotel.NAME, "hotelName"); columns.setCssClass(Hotel.STREET, "streetName"); }
From source file:org.ujorm.wicket.component.grid.UjoDataProvider.java
License:Apache License
/** Create AJAX-based DataTable */ public <S> DataTable<T, S> createDataTable(final String id, final int rowsPerPage) { final DataTable<T, S> result = new DataTable<T, S>(id, (List) columns, this, rowsPerPage) { @Override//from w w w . j a v a2 s . c o m protected Item<T> newRowItem(final String id, final int index, final IModel<T> model) { return new OddEvenItem<T>(id, index, model); } }; result.addTopToolbar(new AjaxNavigationToolbar(result)); result.addTopToolbar(new HeadersToolbar(result, this)); result.addBottomToolbar(new NoRecordsToolbar(result)); result.setOutputMarkupId(true); return result; }
From source file:sk.lazyman.gizmo.component.data.TablePanel.java
License:Apache License
private void initLayout(List<IColumn<T, String>> columns, ISortableDataProvider provider, int rowsPerPage) { DataTable<T, String> table = new DataTable<>(ID_TABLE, columns, provider, rowsPerPage); table.setOutputMarkupId(true);/*from ww w .j a va 2s. c o m*/ TableHeadersToolbar headers = new TableHeadersToolbar(table, provider); headers.setOutputMarkupId(true); table.addTopToolbar(headers); CountToolbar count = new CountToolbar(table); addVisibleBehaviour(count, showCount); table.addBottomToolbar(count); add(table); NavigatorPanel nb2 = new NavigatorPanel(ID_PAGING, table, true); addVisibleBehaviour(nb2, showPaging); add(nb2); setItemsPerPage(rowsPerPage); }