use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class PageDebugView method initButtons.
private void initButtons(final Form mainForm) {
AjaxSubmitButton saveButton = new AjaxSubmitButton("saveButton", createStringResource("pageDebugView.button.save")) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
savePerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target, Form<?> form) {
target.add(getFeedbackPanel());
}
};
mainForm.add(saveButton);
AjaxButton backButton = new AjaxButton("backButton", createStringResource("pageDebugView.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
mainForm.add(backButton);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class TaskMainPanel method initButtons.
private void initButtons(Form mainForm) {
WebMarkupContainer buttonPanel = new WebMarkupContainer(ID_BUTTON_PANEL);
buttonPanel.setOutputMarkupId(true);
mainForm.add(buttonPanel);
final TaskButtonsVisibility visibility = new TaskButtonsVisibility();
AjaxButton backButton = new AjaxButton(ID_BACK, parentPage.createStringResource("pageTaskEdit.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().backPerformed(target);
}
};
backButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeBackVisible(parentPage);
}
});
buttonPanel.add(backButton);
AjaxButton cancelEditingButton = new AjaxButton(ID_CANCEL_EDITING, parentPage.createStringResource("pageTaskEdit.button.cancelEditing")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().cancelEditingPerformed(target);
}
};
cancelEditingButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeCancelEditVisible(parentPage);
}
});
buttonPanel.add(cancelEditingButton);
AjaxSubmitButton saveButton = new AjaxSubmitButton(ID_SAVE, parentPage.createStringResource("pageTaskEdit.button.save")) {
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
parentPage.getController().savePerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(parentPage.getFeedbackPanel());
}
};
saveButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeSaveVisible(parentPage);
}
});
mainForm.setDefaultButton(saveButton);
buttonPanel.add(saveButton);
AjaxButton editButton = new AjaxButton(ID_EDIT, parentPage.createStringResource("pageTaskEdit.button.edit")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.setEdit(true);
// stops refreshing as well
parentPage.refresh(target);
target.add(getMainForm());
}
};
editButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeEditVisible(parentPage);
}
});
buttonPanel.add(editButton);
AjaxButton suspend = new AjaxButton(ID_SUSPEND, parentPage.createStringResource("pageTaskEdit.button.suspend")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().suspendPerformed(target);
}
};
suspend.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeSuspendVisible(parentPage);
}
});
buttonPanel.add(suspend);
AjaxButton resume = new AjaxButton(ID_RESUME, parentPage.createStringResource("pageTaskEdit.button.resume")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().resumePerformed(target);
}
};
resume.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeResumeVisible(parentPage);
}
});
buttonPanel.add(resume);
AjaxButton runNow = new AjaxButton(ID_RUN_NOW, parentPage.createStringResource("pageTaskEdit.button.runNow")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().runNowPerformed(target);
}
};
runNow.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeRunNowVisible(parentPage);
}
});
buttonPanel.add(runNow);
AjaxButton stopApproval = new AjaxButton(ID_STOP_APPROVAL, parentPage.createStringResource("pageTaskEdit.button.stopApprovalProcess")) {
@Override
public void onClick(AjaxRequestTarget target) {
parentPage.getController().stopApprovalProcessPerformed(target);
}
};
stopApproval.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return visibility.computeStopVisible(parentPage);
}
});
buttonPanel.add(stopApproval);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class ExportingPanel method initLayout.
private void initLayout() {
MidpointForm form = new MidpointForm<>(ID_MAIN_FORM, true);
MessagePanel warningMessage = new MessagePanel(ID_WARNING_MESSAGE, MessagePanel.MessagePanelType.WARN, getWarningMessageModel());
warningMessage.setOutputMarkupId(true);
warningMessage.add(new VisibleBehaviour(() -> getWarningMessageModel() != null));
form.add(warningMessage);
FeedbackAlerts feedbackList = new FeedbackAlerts(ID_FEEDBACK);
feedbackList.setOutputMarkupId(true);
feedbackList.setOutputMarkupPlaceholderTag(true);
form.add(feedbackList);
TextPanel<String> nameField = new TextPanel<>(ID_NAME, nameModel);
form.add(nameField);
BoxedTablePanel<SelectableBean<Integer>> table = createTable(ID_TABLE, dataTable);
form.add(table);
AjaxSubmitButton exportSelected = new AjaxSubmitButton(ID_EXPORT, getPageBase().createStringResource("ExportingPopupPanel.exportSelected")) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target) {
performSelectedColumns(table);
if (exportedColumnsIndex.isEmpty()) {
LOGGER.warn("None columns selected");
getPageBase().warn(getPageBase().createStringResource("ExportingPanel.message.error.selectColumn").getString());
target.add(feedbackList);
return;
}
((PageBase) getPage()).hideMainPopup(target);
exportPerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getPageBase().getFeedbackPanel());
}
};
form.add(exportSelected);
AjaxButton cancelButton = new AjaxButton(ID_CANCEL, new StringResourceModel("Button.cancel", this, null)) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
cancelPerformed(target);
}
};
form.add(cancelButton);
add(form);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class PageResourceVisualization method initLayout.
private void initLayout() {
MidpointForm<?> form = new MidpointForm<>(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<>(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) {
redirectBack();
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
}
};
form.add(back);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class ReportMainPanel method initLayoutSaveAndRunButton.
private void initLayoutSaveAndRunButton(PageAdminObjectDetails<ReportType> parentPage) {
AjaxSubmitButton saveAndRunButton = new AjaxSubmitButton(ID_SAVE_AND_RUN, parentPage.createStringResource("pageReport.button.saveAndRun")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
((PageReport) getDetailsPage()).saveAndRunPerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(parentPage.getFeedbackPanel());
}
};
saveAndRunButton.add(getVisibilityForSaveAndRunButton());
saveAndRunButton.setOutputMarkupId(true);
saveAndRunButton.setOutputMarkupPlaceholderTag(true);
getMainForm().add(saveAndRunButton);
}
Aggregations