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);
}
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);
}
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);
}
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();
}
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());
}
Aggregations