use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class PageDebugView method initButtons.
private void initButtons(final MidpointForm<?> mainForm) {
AjaxSubmitButton saveButton = new AjaxSubmitButton("saveButton", createStringResource("pageDebugView.button.save")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
savePerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
}
};
mainForm.add(saveButton);
AjaxButton backButton = new AjaxButton("backButton", createStringResource("pageDebugView.button.back")) {
private static final long serialVersionUID = 1L;
@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 PageImportObject method initButtons.
private void initButtons(WebMarkupContainer buttonBar, IModel<Integer> inputType) {
AjaxButton backButton = new AjaxButton(ID_BACK_BUTTON, createStringResource("PageCertCampaign.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
backButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return canRedirectBack();
}
});
buttonBar.add(backButton);
AjaxSubmitButton saveFileButton = new AjaxSubmitButton(ID_IMPORT_FILE_BUTTON, createStringResource("PageImportObject.button.import")) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
savePerformed(false, OPERATION_IMPORT_FILE, target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
}
};
addVisibileForInputType(saveFileButton, INPUT_FILE, inputType);
buttonBar.add(saveFileButton);
AjaxSubmitButton saveXmlButton = new AjaxSubmitButton(ID_IMPORT_XML_BUTTON, createStringResource("PageImportObject.button.import")) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
String operation = OPERATION_IMPORT + "." + dataLanguage;
savePerformed(true, operation, target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
}
};
addVisibileForInputType(saveXmlButton, INPUT_XML, inputType);
buttonBar.add(saveXmlButton);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class InternalsClockPanel method onInitialize.
@Override
protected void onInitialize() {
super.onInitialize();
setOutputMarkupId(true);
Form form = new MidpointForm<>(ID_FORM);
form.setOutputMarkupId(true);
add(form);
DatePanel offset = new DatePanel(ID_OFFSET, getModel());
form.add(offset);
AjaxSubmitButton saveButton = new AjaxSubmitButton(ID_BUTTON_SAVE, createStringResource("PageInternals.button.changeTime")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
savePerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getPageBase().getFeedbackPanel());
}
};
form.add(saveButton);
AjaxSubmitButton resetButton = new AjaxSubmitButton(ID_BUTTON_RESET, createStringResource("PageInternals.button.resetTimeChange")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
resetPerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getPageBase().getFeedbackPanel());
}
};
form.add(resetButton);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class AbstractSearchItemPanel method initLayout.
protected void initLayout() {
setOutputMarkupId(true);
WebMarkupContainer searchItemContainer = new WebMarkupContainer(ID_SEARCH_ITEM_CONTAINER);
searchItemContainer.setOutputMarkupId(true);
add(searchItemContainer);
IModel<String> labelModel = createLabelModel();
Label searchItemLabel = new Label(ID_SEARCH_ITEM_LABEL, labelModel);
searchItemLabel.setOutputMarkupId(true);
searchItemLabel.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(labelModel.getObject())));
IModel<String> titleModel = createTitleModel();
if (StringUtils.isNotEmpty(titleModel.getObject())) {
searchItemLabel.add(AttributeAppender.append("title", titleModel));
}
searchItemContainer.add(searchItemLabel);
Label help = new Label(ID_HELP);
IModel<String> helpModel = createHelpModel();
help.add(AttributeModifier.replace("title", createStringResource(helpModel.getObject() != null ? helpModel.getObject() : "")));
help.add(new InfoTooltipBehavior() {
@Override
public String getDataPlacement() {
return "left";
}
});
// help.add(new VisibleBehaviour(() -> StringUtils.isNotEmpty(helpModel.getObject())));
searchItemContainer.add(help);
initSearchItemField(searchItemContainer);
AjaxSubmitButton removeButton = new AjaxSubmitButton(ID_REMOVE_BUTTON) {
private static final long serialVersionUID = 1L;
@Override
public void onSubmit(AjaxRequestTarget target) {
deletePerformed(target);
}
};
removeButton.add(new VisibleBehaviour(() -> canRemoveSearchItem()));
removeButton.setOutputMarkupId(true);
searchItemContainer.add(removeButton);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class TaskMainPanel method initLayoutSaveAndRunButton.
protected void initLayoutSaveAndRunButton() {
AjaxSubmitButton saveButton = new AjaxSubmitButton(ID_SAVE_AND_RUN, getDetailsPage().createStringResource("TaskMainPanel.button.saveAndRun")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
((PageTask) getDetailsPage()).saveAndRunPerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getDetailsPage().getFeedbackPanel());
}
};
saveButton.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return !getObjectWrapper().isReadOnly() && !getDetailsPage().isForcedPreview();
}
@Override
public boolean isEnabled() {
return !ItemStatus.NOT_CHANGED.equals(getObjectWrapper().getStatus()) || getObjectWrapper().canModify();
}
});
saveButton.setOutputMarkupId(true);
saveButton.setOutputMarkupPlaceholderTag(true);
getMainForm().add(saveButton);
}
Aggregations