Search in sources :

Example 16 with DataTable

use of org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable in project midpoint by Evolveum.

the class PageCreatedReports method getTableDataProvider.

private ObjectDataProvider getTableDataProvider() {
    Table tablePanel = getReportOutputTable();
    DataTable table = tablePanel.getDataTable();
    return (ObjectDataProvider) table.getDataProvider();
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) Table(com.evolveum.midpoint.web.component.data.Table) DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider)

Example 17 with DataTable

use of org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable in project midpoint by Evolveum.

the class ObjectSelectionPanel method updateTableByTypePerformed.

public void updateTableByTypePerformed(AjaxRequestTarget target, Class<? extends ObjectType> newType) {
    this.objectType = newType;
    TablePanel table = getTablePanel();
    DataTable dataTable = table.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) dataTable.getDataProvider();
    provider.setType(objectType);
    target.add(this, WebComponentUtil.getPageBase(this).getFeedbackPanel(), table);
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 18 with DataTable

use of org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable in project midpoint by Evolveum.

the class OrgUnitAddDeletePopup method setState.

public void setState(ActionState state, AjaxRequestTarget target) {
    this.state = state;
    AjaxButton actionButton = (AjaxButton) getContent().get(ID_BUTTON_ACTION);
    actionButton.setModel(createActionButtonStringResource());
    actionButton.add(new AttributeAppender("class", getActionButtonClass()));
    target.add(actionButton);
    TablePanel panel = getTable();
    DataTable table = panel.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
    provider.setQuery(getDataProviderQuery());
    target.add(panel);
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) AttributeAppender(org.apache.wicket.behavior.AttributeAppender) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 19 with DataTable

use of org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable in project midpoint by Evolveum.

the class CountToolbar method createModel.

private IModel<String> createModel() {
    return new LoadableModel<String>() {

        @Override
        protected String load() {
            long from = 0;
            long to = 0;
            long count = 0;
            IPageable pageable = getTable();
            if (pageable instanceof DataViewBase) {
                DataViewBase view = (DataViewBase) pageable;
                from = view.getFirstItemOffset() + 1;
                to = from + view.getItemsPerPage() - 1;
                long itemCount = view.getItemCount();
                if (to > itemCount) {
                    to = itemCount;
                }
                count = itemCount;
            } else if (pageable instanceof DataTable) {
                DataTable table = (DataTable) pageable;
                from = table.getCurrentPage() * table.getItemsPerPage() + 1;
                to = from + table.getItemsPerPage() - 1;
                long itemCount = table.getItemCount();
                if (to > itemCount) {
                    to = itemCount;
                }
                count = itemCount;
            }
            if (count > 0) {
                PageBase.createStringResourceStatic(CountToolbar.this, "CountToolbar.label", new Object[] { from, to, count });
            }
            return PageBase.createStringResourceStatic(CountToolbar.this, "CountToolbar.noFound").getString();
        }
    };
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) DataViewBase(org.apache.wicket.markup.repeater.data.DataViewBase) LoadableModel(com.evolveum.midpoint.gui.api.model.LoadableModel) IPageable(org.apache.wicket.markup.html.navigation.paging.IPageable)

Example 20 with DataTable

use of org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable in project midpoint by Evolveum.

the class PageConnectorHosts method searchHostPerformed.

private void searchHostPerformed(ObjectQuery query, AjaxRequestTarget target) {
    target.add(getFeedbackPanel());
    Table panel = getConnectorHostTable();
    DataTable table = panel.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) table.getDataProvider();
    provider.setQuery(query);
    provider.setOptions(SelectorOptions.createCollection(GetOperationOptions.createNoFetch()));
    target.add((Component) panel);
}
Also used : DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) Table(com.evolveum.midpoint.web.component.data.Table) DataTable(org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider)

Aggregations

DataTable (org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable)20 ObjectDataProvider (com.evolveum.midpoint.web.component.data.ObjectDataProvider)10 Table (com.evolveum.midpoint.web.component.data.Table)7 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)7 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)3 IModel (org.apache.wicket.model.IModel)3 Model (org.apache.wicket.model.Model)3 ConfigurationStorage (com.evolveum.midpoint.web.session.ConfigurationStorage)2 TasksStorage (com.evolveum.midpoint.web.session.TasksStorage)2 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)2 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)2 AbstractReadOnlyModel (org.apache.wicket.model.AbstractReadOnlyModel)2 LoadableModel (com.evolveum.midpoint.gui.api.model.LoadableModel)1 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)1 BaseSortableDataProvider (com.evolveum.midpoint.web.component.data.BaseSortableDataProvider)1 RepositoryObjectDataProvider (com.evolveum.midpoint.web.component.data.RepositoryObjectDataProvider)1 SelectableDataTable (com.evolveum.midpoint.web.component.data.SelectableDataTable)1 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)1 CertWorkItemDtoProvider (com.evolveum.midpoint.web.page.admin.certification.dto.CertWorkItemDtoProvider)1 AccountDetailsSearchDto (com.evolveum.midpoint.web.page.admin.configuration.dto.AccountDetailsSearchDto)1