use of com.evolveum.midpoint.web.component.assignment.AssignmentDetailsPanel in project midpoint by Evolveum.
the class PageAssignmentDetails method initLayout.
public void initLayout(final IModel<AssignmentEditorDto> assignmentModel) {
setOutputMarkupId(true);
Form mainForm = new Form(ID_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);
AssignmentDetailsPanel detailsPanel = new AssignmentDetailsPanel(ID_DETAILS_PANEL, assignmentModel, PageAssignmentDetails.this);
detailsPanel.setOutputMarkupId(true);
mainForm.add(detailsPanel);
AjaxButton back = new AjaxButton(ID_BACK, createStringResource("PageAssignmentDetails.backButton")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
mainForm.add(back);
AjaxButton addToCart = new AjaxButton(ID_ADD_TO_CART, createStringResource("PageAssignmentDetails.addToCartButton")) {
@Override
public void onClick(AjaxRequestTarget target) {
RoleCatalogStorage storage = getSessionStorage().getRoleCatalog();
if (storage.getAssignmentShoppingCart() == null) {
storage.setAssignmentShoppingCart(new ArrayList<AssignmentEditorDto>());
}
AssignmentEditorDto dto = assignmentModel.getObject();
dto.setMinimized(true);
dto.setSimpleView(false);
storage.getAssignmentShoppingCart().add(dto);
redirectBack();
}
};
mainForm.add(addToCart);
}
Aggregations