use of com.evolveum.midpoint.web.component.form.Form 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);
}
use of com.evolveum.midpoint.web.component.form.Form in project midpoint by Evolveum.
the class PageSystemConfiguration method initButtons.
private void initButtons(Form mainForm) {
AjaxSubmitButton save = new AjaxSubmitButton(ID_SAVE, createStringResource("PageBase.button.save")) {
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
savePerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form form) {
target.add(getFeedbackPanel());
}
};
mainForm.add(save);
AjaxButton cancel = new AjaxButton(ID_CANCEL, createStringResource("PageBase.button.cancel")) {
@Override
public void onClick(AjaxRequestTarget target) {
cancelPerformed(target);
}
};
mainForm.add(cancel);
}
use of com.evolveum.midpoint.web.component.form.Form in project midpoint by Evolveum.
the class MergeObjectsPanel method initLayout.
private void initLayout() {
Form mainForm = new Form(ID_FORM);
mainForm.setOutputMarkupId(true);
add(mainForm);
DropDownChoicePanel mergeTypeSelect = new DropDownChoicePanel(ID_MERGE_TYPE_SELECTOR, mergeTypeModel, mergeTypeChoicesModel);
mergeTypeSelect.getBaseFormComponent().add(new OnChangeAjaxBehavior() {
@Override
protected void onUpdate(AjaxRequestTarget target) {
mergeResultObject = getMergeObjectsResult();
WebMarkupContainer resultObjectPanel = (WebMarkupContainer) get(ID_FORM).get(ID_OBJECTS_PANEL).get(ID_MERGE_RESULT_PANEL_CONTAINER);
resultObjectPanel.addOrReplace(getMergeResultObjectPanel());
target.add(resultObjectPanel);
}
});
mergeTypeSelect.setOutputMarkupId(true);
mainForm.add(mergeTypeSelect);
final WebMarkupContainer objectsPanel = new WebMarkupContainer(ID_OBJECTS_PANEL);
objectsPanel.setOutputMarkupId(true);
mainForm.addOrReplace(objectsPanel);
initObjectsPanel(objectsPanel);
AjaxButton switchDirectionButton = new AjaxButton(ID_SWITCH_DIRECTION_BUTTON, pageBase.createStringResource("MergeObjectsPanel.switchDirection")) {
@Override
public void onClick(AjaxRequestTarget ajaxRequestTarget) {
F temp = mergeObjectModel.getObject();
mergeObjectModel.setObject(mergeWithObjectModel.getObject());
mergeWithObjectModel.setObject(temp);
initObjectsPanel(objectsPanel);
ajaxRequestTarget.add(objectsPanel);
}
};
switchDirectionButton.setOutputMarkupId(true);
mainForm.add(switchDirectionButton);
}
use of com.evolveum.midpoint.web.component.form.Form in project midpoint by Evolveum.
the class PageResourceVisualization method initLayout.
private void initLayout() {
Form form = new Form(ID_FORM);
add(form);
WebMarkupContainer dotContainer = new WebMarkupContainer(ID_DOT_CONTAINER);
dotContainer.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visualizationModel.getObject().getSvg() == null;
}
});
form.add(dotContainer);
TextArea<String> dot = new TextArea<>(ID_DOT, new PropertyModel<String>(visualizationModel, ResourceVisualizationDto.F_DOT));
dotContainer.add(dot);
Label error = new Label(ID_ERROR, new PropertyModel<String>(visualizationModel, ResourceVisualizationDto.F_EXCEPTION_AS_STRING));
dotContainer.add(error);
Label svg = new Label(ID_SVG, new PropertyModel<String>(visualizationModel, ResourceVisualizationDto.F_SVG));
svg.setEscapeModelStrings(false);
svg.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visualizationModel.getObject().getSvg() != null;
}
});
form.add(svg);
AjaxSubmitButton back = new AjaxSubmitButton(ID_BACK) {
@Override
public void onSubmit(AjaxRequestTarget ajaxRequestTarget, org.apache.wicket.markup.html.form.Form<?> form) {
redirectBack();
}
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(getFeedbackPanel());
}
};
form.add(back);
}
use of com.evolveum.midpoint.web.component.form.Form in project midpoint by Evolveum.
the class PageSystemConfiguration method initLayout.
private void initLayout() {
Form mainForm = new Form(ID_MAIN_FORM, true);
add(mainForm);
List<ITab> tabs = new ArrayList<>();
tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.system.title")) {
@Override
public WebMarkupContainer getPanel(String panelId) {
systemConfigPanel = new SystemConfigPanel(panelId, model);
return systemConfigPanel;
}
});
tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.notifications.title")) {
@Override
public WebMarkupContainer getPanel(String panelId) {
notificationConfigPanel = new NotificationConfigPanel(panelId, new PropertyModel<NotificationConfigurationDto>(model, "notificationConfig"));
return notificationConfigPanel;
}
});
tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.logging.title")) {
@Override
public WebMarkupContainer getPanel(String panelId) {
loggingConfigPanel = new LoggingConfigPanel(panelId, new PropertyModel<LoggingDto>(model, "loggingConfig"));
return loggingConfigPanel;
}
});
tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.profiling.title")) {
@Override
public WebMarkupContainer getPanel(String panelId) {
profilingConfigPanel = new ProfilingConfigPanel(panelId, new PropertyModel<ProfilingDto>(model, "profilingDto"), PageSystemConfiguration.this);
return profilingConfigPanel;
}
});
tabs.add(new AbstractTab(createStringResource("pageSystemConfiguration.adminGui.title")) {
@Override
public WebMarkupContainer getPanel(String panelId) {
adminGuiConfigPanel = new AdminGuiConfigPanel(panelId, model);
return adminGuiConfigPanel;
}
});
TabbedPanel tabPanel = new TabbedPanel(ID_TAB_PANEL, tabs) {
@Override
protected void onTabChange(int index) {
PageParameters params = getPageParameters();
params.set(SELECTED_TAB_INDEX, index);
}
};
tabPanel.setOutputMarkupId(true);
mainForm.add(tabPanel);
initButtons(mainForm);
}
Aggregations