Search in sources :

Example 11 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class AbstractShoppingCartTabPanel method initShoppingCartItemsPanel.

private void initShoppingCartItemsPanel(WebMarkupContainer shoppingCartContainer) {
    GridViewComponent<ObjectDataProvider<AssignmentEditorDto, AbstractRoleType>> catalogItemsGrid = new GridViewComponent<ObjectDataProvider<AssignmentEditorDto, AbstractRoleType>>(ID_SHOPPING_CART_ITEMS_PANEL, new LoadableModel<ObjectDataProvider<AssignmentEditorDto, AbstractRoleType>>() {

        @Override
        protected ObjectDataProvider<AssignmentEditorDto, AbstractRoleType> load() {
            return getTabPanelProvider();
        }
    }) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(Item item) {
            item.add(new RoleCatalogItemButton(getCellItemId(), item.getModel()) {

                private static final long serialVersionUID = 1L;

                @Override
                protected void assignmentAddedToShoppingCartPerformed(AjaxRequestTarget target) {
                    int assignmentsLimit = getRoleCatalogStorage().getAssignmentRequestLimit();
                    if (AssignmentsUtil.isShoppingCartAssignmentsLimitReached(assignmentsLimit, AbstractShoppingCartTabPanel.this.getPageBase())) {
                        target.add(AbstractShoppingCartTabPanel.this);
                    }
                    AbstractShoppingCartTabPanel.this.assignmentAddedToShoppingCartPerformed(target);
                }

                @Override
                protected QName getNewAssignmentRelation() {
                    return AbstractShoppingCartTabPanel.this.getNewAssignmentRelation();
                }
            });
        }
    };
    catalogItemsGrid.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return isShoppingCartItemsPanelVisible();
        }
    });
    catalogItemsGrid.setOutputMarkupId(true);
    shoppingCartContainer.add(catalogItemsGrid);
}
Also used : QName(javax.xml.namespace.QName) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) Item(org.apache.wicket.markup.repeater.Item) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)

Example 12 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class OrgUnitAddDeletePopup method initLayout.

public void initLayout(WebMarkupContainer content) {
    List<IColumn<SelectableBeanImpl<ObjectType>, String>> columns = initColumns();
    ObjectQuery query = getDataProviderQuery();
    ObjectDataProvider provider = new ObjectDataProvider(getPageBase(), null) {

        @Override
        public ObjectQuery getQuery() {
            return query;
        }

        @Override
        public Class getType() {
            return OrgType.class;
        }
    };
    TablePanel table = new TablePanel<>(ID_TABLE, provider, columns);
    table.setOutputMarkupId(true);
    content.add(table);
    AjaxButton cancelButton = new AjaxButton(ID_BUTTON_CANCEL, createStringResource("orgUnitAddDeletePopup.button.cancel")) {

        @Override
        public void onClick(AjaxRequestTarget ajaxRequestTarget) {
            cancelPerformed(ajaxRequestTarget);
        }
    };
    content.add(cancelButton);
    AjaxButton actionButton = new AjaxButton(ID_BUTTON_ACTION, createActionButtonStringResource()) {

        @Override
        public void onClick(AjaxRequestTarget target) {
            actionPerformed(target);
        }
    };
    actionButton.add(new AttributeAppender("class", getActionButtonClass()));
    content.add(actionButton);
}
Also used : AjaxRequestTarget(org.apache.wicket.ajax.AjaxRequestTarget) ObjectType(com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType) AjaxButton(com.evolveum.midpoint.web.component.AjaxButton) IColumn(org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn) OrgType(com.evolveum.midpoint.xml.ns._public.common.common_3.OrgType) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) ObjectQuery(com.evolveum.midpoint.prism.query.ObjectQuery) AttributeAppender(org.apache.wicket.behavior.AttributeAppender) TablePanel(com.evolveum.midpoint.web.component.data.TablePanel)

Example 13 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class ObjectSelectionPanel method updateTablePerformed.

public void updateTablePerformed(AjaxRequestTarget target, ObjectQuery query) {
    TablePanel table = getTablePanel();
    DataTable dataTable = table.getDataTable();
    ObjectDataProvider provider = (ObjectDataProvider) dataTable.getDataProvider();
    provider.setQuery(query);
    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 14 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider 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 15 with ObjectDataProvider

use of com.evolveum.midpoint.web.component.data.ObjectDataProvider in project midpoint by Evolveum.

the class PageCreatedReports method deleteSelectedConfirmedPerformed.

private void deleteSelectedConfirmedPerformed(AjaxRequestTarget target, List<ReportOutputType> objects) {
    OperationResult result = new OperationResult(OPERATION_DELETE);
    for (ReportOutputType output : objects) {
        WebModelServiceUtils.deleteObject(ReportOutputType.class, output.getOid(), result, this);
    }
    result.computeStatusIfUnknown();
    ObjectDataProvider provider = getTableDataProvider();
    provider.clearCache();
    showResult(result);
    target.add((Component) getReportOutputTable());
    target.add(getFeedbackPanel());
}
Also used : OperationResult(com.evolveum.midpoint.schema.result.OperationResult) ObjectDataProvider(com.evolveum.midpoint.web.component.data.ObjectDataProvider) ReportOutputType(com.evolveum.midpoint.xml.ns._public.common.common_3.ReportOutputType)

Aggregations

ObjectDataProvider (com.evolveum.midpoint.web.component.data.ObjectDataProvider)23 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)13 DataTable (org.apache.wicket.extensions.markup.html.repeater.data.table.DataTable)12 Table (com.evolveum.midpoint.web.component.data.Table)5 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)5 ObjectQuery (com.evolveum.midpoint.prism.query.ObjectQuery)4 AjaxButton (com.evolveum.midpoint.web.component.AjaxButton)4 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)4 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)3 PrismObject (com.evolveum.midpoint.prism.PrismObject)2 ObjectSearchDto (com.evolveum.midpoint.web.page.admin.configuration.dto.ObjectSearchDto)2 ConfigurationStorage (com.evolveum.midpoint.web.session.ConfigurationStorage)2 ReportsStorage (com.evolveum.midpoint.web.session.ReportsStorage)2 ObjectType (com.evolveum.midpoint.xml.ns._public.common.common_3.ObjectType)2 AttributeAppender (org.apache.wicket.behavior.AttributeAppender)2 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)2 Form (org.apache.wicket.markup.html.form.Form)2 PageBase (com.evolveum.midpoint.gui.api.page.PageBase)1 Task (com.evolveum.midpoint.task.api.Task)1 AjaxDownloadBehaviorFromFile (com.evolveum.midpoint.web.component.AjaxDownloadBehaviorFromFile)1