use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class PageAccount method initButtons.
private void initButtons(Form mainForm) {
AjaxSubmitButton save = new AjaxSubmitButton(ID_SAVE, createStringResource("pageAccount.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());
}
};
save.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
ShadowWrapper wrapper = accountModel.getObject();
return !wrapper.isProtected();
}
});
mainForm.add(save);
AjaxButton back = new AjaxButton(ID_BACK, createStringResource("pageAccount.button.back")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
cancelPerformed(target);
}
};
mainForm.add(back);
AjaxButton editXmlButton = new AjaxButton(ID_EDIT_XML, createStringResource("AbstractObjectMainPanel.editXmlButton")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
ConfirmationPanel confirmationPanel = new ConfirmationPanel(getMainPopupBodyId(), createStringResource("AbstractObjectMainPanel.confirmEditXmlRedirect")) {
private static final long serialVersionUID = 1L;
@Override
public void yesPerformed(AjaxRequestTarget target) {
PageParameters parameters = new PageParameters();
parameters.add(PageDebugView.PARAM_OBJECT_ID, accountModel.getObject().getOid());
parameters.add(PageDebugView.PARAM_OBJECT_TYPE, "ShadowType");
navigateToNext(PageDebugView.class, parameters);
}
};
showMainPopup(confirmationPanel, target);
}
};
editXmlButton.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_CONFIGURATION_URL, AuthorizationConstants.AUTZ_UI_CONFIGURATION_DEBUG_URL) && !accountModel.getObject().isReadOnly();
}
});
mainForm.add(editXmlButton);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class MultiplicityPolicyPanel method initButtons.
private void initButtons(Form mainForm) {
AjaxSubmitButton cancel = new AjaxSubmitButton(ID_BUTTON_CANCEL, createStringResource("PageBase.button.cancel")) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
cancelPerformed(target);
}
};
mainForm.add(cancel);
AjaxSubmitButton save = new AjaxSubmitButton(ID_BUTTON_SAVE, createStringResource("PageBase.button.save")) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
savePerformed(target);
}
};
mainForm.add(save);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class ConfigurationStep method initLayout.
private void initLayout() {
MidpointForm form = new MidpointForm<>(ID_MAIN, true);
form.setOutputMarkupId(true);
add(form);
form.add(WebComponentUtil.createTabPanel(ID_CONFIGURATION, parentPage, createConfigurationTabs(), null));
AjaxSubmitButton testConnection = new AjaxSubmitButton(ID_TEST_CONNECTION, createStringResource("ConfigurationStep.button.testConnection")) {
@Override
protected void onError(final AjaxRequestTarget target) {
WebComponentUtil.refreshFeedbacks(form, target);
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
testConnectionPerformed(target);
}
};
testConnection.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return !parentPage.isReadOnly();
}
});
add(testConnection);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class PageRequestRole method initButtons.
private void initButtons(Form mainForm) {
AjaxSubmitButton save = new AjaxSubmitButton(ID_SAVE_BUTTON, createStringResource("PageBase.button.save")) {
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(getFeedbackPanel());
}
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
onSavePerformed(target);
}
};
mainForm.setDefaultButton(save);
mainForm.add(save);
AjaxSubmitButton cancel = new AjaxSubmitButton(ID_CANCEL_BUTTON, createStringResource("PageBase.button.back")) {
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(getFeedbackPanel());
}
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
// onCancelPerformed(target);
}
};
mainForm.add(cancel);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class SearchItemPanel method initPopover.
private void initPopover() {
WebMarkupContainer popover = new WebMarkupContainer(ID_POPOVER);
popover.setOutputMarkupId(true);
add(popover);
WebMarkupContainer popoverBody = new WebMarkupContainer(ID_POPOVER_BODY);
popoverBody.setOutputMarkupId(true);
popover.add(popoverBody);
ListView values = new ListView<DisplayableValue>(ID_VALUES, new PropertyModel<List<DisplayableValue>>(popoverModel, SearchItem.F_VALUES)) {
@Override
protected void populateItem(final ListItem<DisplayableValue> item) {
item.add(AttributeModifier.replace("style", new AbstractReadOnlyModel<String>() {
@Override
public String getObject() {
return item.getIndex() != 0 ? "margin-top: 5px;" : null;
}
}));
SearchPopupPanel fragment = createPopoverFragment(item.getModel());
fragment.setRenderBodyOnly(true);
item.add(fragment);
}
};
popoverBody.add(values);
AjaxSubmitButton update = new AjaxSubmitButton(ID_UPDATE, createStringResource("SearchItemPanel.update")) {
@Override
protected void onSubmit(AjaxRequestTarget target, Form<?> form) {
updateItemPerformed(target);
}
};
popoverBody.add(update);
AjaxButton close = new AjaxButton(ID_CLOSE, createStringResource("SearchItemPanel.close")) {
@Override
public void onClick(AjaxRequestTarget target) {
closeEditPopoverPerformed(target);
}
};
popoverBody.add(close);
}
Aggregations