use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class RunReportPopupPanel method initLayout.
protected void initLayout() {
Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);
add(mainForm);
FeedbackAlerts feedback = new FeedbackAlerts(ID_POPUP_FEEDBACK);
ReportObjectsListPanel table = new ReportObjectsListPanel(ID_TABLE, getModel()) {
private final boolean checkViewAfterInitialize = true;
@Override
public Component getFeedbackPanel() {
return feedback;
}
@Override
protected boolean checkViewAfterInitialize() {
if (checkViewAfterInitialize) {
return true;
}
return super.checkViewAfterInitialize();
}
};
table.setOutputMarkupId(true);
mainForm.add(table);
feedback.setFilter(new ComponentFeedbackMessageFilter(table) {
private static final long serialVersionUID = 1L;
@Override
public boolean accept(FeedbackMessage message) {
return true;
}
});
feedback.setOutputMarkupId(true);
mainForm.add(feedback);
AjaxSubmitButton runButton = new AjaxSubmitButton(ID_RUN_BUTTON, createStringResource("runReportPopupContent.button.run")) {
private static final long serialVersionUID = 1L;
@Override
protected void onError(AjaxRequestTarget target) {
FeedbackAlerts feedback = (FeedbackAlerts) getForm().get(ID_POPUP_FEEDBACK);
target.add(feedback);
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
runConfirmPerformed(target);
}
};
runButton.setOutputMarkupId(true);
runButton.add(new VisibleBehaviour(() -> isRunnable));
mainForm.add(runButton);
AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, createStringResource("userBrowserDialog.button.cancelButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
getPageBase().hideMainPopup(target);
}
};
cancelButton.setOutputMarkupId(true);
mainForm.add(cancelButton);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class ImportReportPopupPanel method initLayout.
protected void initLayout() {
Form<?> mainForm = new MidpointForm<>(ID_MAIN_FORM);
add(mainForm);
FeedbackAlerts feedback = new FeedbackAlerts(ID_POPUP_FEEDBACK);
feedback.setOutputMarkupId(true);
mainForm.add(feedback);
Model<String> nameModel = Model.of("");
TextPanel nameField = new TextPanel(ID_NAME_FOR_DATA, nameModel);
nameField.setOutputMarkupId(true);
mainForm.add(nameField);
Model<String> fileStringModel = Model.of("");
TextAreaPanel fileStringField = new TextAreaPanel(ID_FILE_AS_NAME, fileStringModel, 5);
fileStringField.setOutputMarkupId(true);
mainForm.add(fileStringField);
AjaxSubmitButton importButton = new AjaxSubmitButton(ID_IMPORT_BUTTON, createStringResource("PageReports.button.import")) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
importConfirmPerformed(target, nameModel, fileStringModel);
}
@Override
protected void onError(AjaxRequestTarget target) {
FeedbackAlerts feedback = (FeedbackAlerts) getForm().get(ID_POPUP_FEEDBACK);
target.add(feedback);
}
};
mainForm.add(importButton);
AjaxButton cancelButton = new AjaxButton(ID_CANCEL_BUTTON, createStringResource("userBrowserDialog.button.cancelButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
ImportReportPopupPanel.this.getPageBase().hideMainPopup(target);
}
};
cancelButton.setOutputMarkupId(true);
mainForm.add(cancelButton);
FileUploadField choseFile = new FileUploadField(ID_CHOSE_FILE);
mainForm.add(choseFile);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class InternalsTracesPanel method onInitialize.
protected void onInitialize() {
super.onInitialize();
setOutputMarkupId(true);
Form form = new MidpointForm<>(ID_FORM);
form.setOutputMarkupId(true);
add(form);
ListView<InternalOperationClasses> tracesTable = new ListView<InternalOperationClasses>(ID_TRACES_TABLE, Arrays.asList(InternalOperationClasses.values())) {
private static final long serialVersionUID = 1L;
@Override
protected void populateItem(ListItem<InternalOperationClasses> item) {
InternalOperationClasses operationClass = item.getModelObject();
CheckFormGroup checkFormGroup = new CheckFormGroup(ID_TRACE_TOGGLE, new PropertyModel<>(tracesMap, operationClass.getKey()), createStringResource("InternalOperationClasses." + operationClass.getKey()), LABEL_SIZE, INPUT_SIZE);
item.add(checkFormGroup);
}
};
form.add(tracesTable);
AjaxSubmitButton update = new AjaxSubmitButton(ID_UPDATE_TRACES, createStringResource("PageBase.button.update")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
updateTraces(target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getPageBase().getFeedbackPanel());
}
};
form.add(update);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class DefinitionStagesPanel method initLayout.
private void initLayout() {
List<ITab> tabs = new ArrayList<>();
createTabs(tabs);
tabPanel = WebComponentUtil.createTabPanel(ID_TAB_PANEL, parentPage, tabs, null);
add(tabPanel);
AjaxSubmitButton addNewStage = new AjaxSubmitButton(ID_ADD_NEW_STAGE, createStringResource("StageDefinitionPanel.addNewStageButton")) {
@Override
public void onSubmit(AjaxRequestTarget target) {
super.onSubmit(target);
addPerformed(target);
}
};
add(addNewStage);
// use the same isVisible for all buttons to avoid changing buttons' placement (especially dangerous is "delete stage" one)
// we also don't use isEnabled as it seems to have no visual effect
VisibleEnableBehaviour visibleIfMoreTabs = new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return getModelObject().size() > 1;
}
};
AjaxSubmitButton moveLeft = new AjaxSubmitButton(ID_MOVE_STAGE_LEFT, createStringResource("StageDefinitionPanel.moveStageLeftButton")) {
@Override
public void onSubmit(AjaxRequestTarget target) {
super.onSubmit(target);
moveLeftPerformed(target);
}
};
moveLeft.add(visibleIfMoreTabs);
add(moveLeft);
AjaxSubmitButton moveRight = new AjaxSubmitButton(ID_MOVE_STAGE_RIGHT, createStringResource("StageDefinitionPanel.moveStageRightButton")) {
@Override
public void onSubmit(AjaxRequestTarget target) {
super.onSubmit(target);
moveRightPerformed(target);
}
};
moveRight.add(visibleIfMoreTabs);
add(moveRight);
AjaxSubmitButton delete = new AjaxSubmitButton(ID_DELETE_STAGE, createStringResource("StageDefinitionPanel.deleteStageButton")) {
@Override
public void onSubmit(AjaxRequestTarget target) {
super.onSubmit(target);
deletePerformed(target);
}
};
delete.add(visibleIfMoreTabs);
add(delete);
setOutputMarkupId(true);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class PageCertDefinition method initButtons.
private void initButtons(final Form mainForm) {
AjaxButton backButton = new AjaxButton(ID_BACK_BUTTON, createStringResource("PageCertDefinition.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
mainForm.add(backButton);
AjaxSubmitButton saveButton = new AjaxSubmitButton(ID_SAVE_BUTTON, createStringResource("PageCertDefinition.button.save")) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
savePerformed(target);
}
};
mainForm.add(saveButton);
}
Aggregations