use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class ProgressPanel method initButtons.
private void initButtons(final Form progressForm, final ProgressReportingAwarePage page) {
AjaxSubmitButton abortButton = new AjaxSubmitButton(ID_ABORT, createStringResource("pageAdminFocus.button.abort")) {
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
progressReporter.onAbortSubmit(target);
}
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(page.getFeedbackPanel());
}
};
progressReporter.registerAbortButton(abortButton);
progressForm.add(abortButton);
AjaxSubmitButton backButton = new AjaxSubmitButton(ID_BACK, createStringResource("pageAdminFocus.button.back")) {
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
backPerformed(target);
}
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(page.getFeedbackPanel());
}
};
progressReporter.registerBackButton(backButton);
progressForm.add(backButton);
AjaxSubmitButton continueEditingButton = new AjaxSubmitButton(ID_CONTINUE_EDITING, createStringResource("pageAdminFocus.button.continueEditing")) {
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
ProgressReportingAwarePage page = (ProgressReportingAwarePage) getPage();
page.continueEditing(target);
}
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
target.add(page.getFeedbackPanel());
}
};
progressReporter.registerContinueEditingButton(continueEditingButton);
progressForm.add(continueEditingButton);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class PageSizePopover method initLayout.
protected void initLayout() {
Button popButton = new Button(ID_POP_BUTTON);
popButton.setOutputMarkupId(true);
add(popButton);
WebMarkupContainer popover = new WebMarkupContainer(ID_POPOVER);
popover.setOutputMarkupId(true);
add(popover);
Form<?> form = new MidpointForm<>(ID_FORM);
popover.add(form);
AjaxSubmitButton button = new AjaxSubmitButton(ID_BUTTON) {
@Override
protected void onError(AjaxRequestTarget target) {
super.onError(target);
target.add(getPageBase().getFeedbackPanel());
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
super.onSubmit(target);
pageSizeChanged(target);
}
};
form.add(button);
TextField<?> input = new TextField<>(ID_INPUT, createInputModel());
input.add(new RangeValidator<>(5, 100));
input.setLabel(createStringResource("PageSizePopover.title"));
input.add(new SearchFormEnterBehavior(button));
input.setType(Integer.class);
form.add(input);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class TableConfigurationPanel method initPopoverLayout.
private void initPopoverLayout() {
WebMarkupContainer popover = new WebMarkupContainer(ID_POPOVER);
popover.setOutputMarkupId(true);
add(popover);
Form<?> form = new MidpointForm<>(ID_FORM);
popover.add(form);
AjaxSubmitButton button = new AjaxSubmitButton(ID_BUTTON) {
@Override
protected void onError(AjaxRequestTarget target) {
target.add(TableConfigurationPanel.this.get(createComponentPath(ID_POPOVER, ID_FORM, "inputFeedback")));
}
@Override
protected void onSubmit(AjaxRequestTarget target) {
pageSizeChanged(target);
}
};
form.add(button);
TextField<?> input = new TextField<>(ID_INPUT, createInputModel());
input.add(new RangeValidator<>(5, 100));
input.setLabel(createStringResource("PageSizePopover.title"));
input.add(new SearchFormEnterBehavior(button));
input.setType(Integer.class);
input.setOutputMarkupId(true);
FeedbackPanel feedback = new FeedbackPanel("inputFeedback", new ComponentFeedbackMessageFilter(input));
feedback.setOutputMarkupId(true);
form.add(feedback);
form.add(input);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class PageCertCampaign method initButtons.
private void initButtons(final Form mainForm) {
AjaxButton backButton = new AjaxButton(ID_BACK_BUTTON, createStringResource("PageCertCampaign.button.back")) {
@Override
public void onClick(AjaxRequestTarget target) {
redirectBack();
}
};
mainForm.add(backButton);
AjaxSubmitButton startCampaignButton = new AjaxSubmitButton(ID_START_CAMPAIGN_BUTTON, createStringResource("PageCertCampaign.button.startCampaign")) {
@Override
protected void onSubmit(AjaxRequestTarget target) {
executeCampaignStateOperation(target, OP_OPEN_NEXT_STAGE);
}
};
startCampaignButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return campaignModel.getObject().getState() == AccessCertificationCampaignStateType.CREATED;
}
});
mainForm.add(startCampaignButton);
AjaxButton nextStageButton = new AjaxButton(ID_OPEN_NEXT_STAGE_BUTTON, createStringResource("PageCertCampaign.button.openNextStage")) {
@Override
public void onClick(AjaxRequestTarget target) {
executeCampaignStateOperation(target, OP_OPEN_NEXT_STAGE);
}
};
nextStageButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return campaignModel.getObject().getState() == AccessCertificationCampaignStateType.REVIEW_STAGE_DONE && campaignModel.getObject().getCurrentStageNumber() < campaignModel.getObject().getNumberOfStages();
}
});
mainForm.add(nextStageButton);
AjaxButton closeStageButton = new AjaxButton(ID_CLOSE_STAGE_BUTTON, createStringResource("PageCertCampaign.button.closeStage")) {
@Override
public void onClick(AjaxRequestTarget target) {
executeCampaignStateOperation(target, OP_CLOSE_STAGE);
}
};
closeStageButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return campaignModel.getObject().getState() == AccessCertificationCampaignStateType.IN_REVIEW_STAGE;
}
});
mainForm.add(closeStageButton);
AjaxButton startRemediationButton = new AjaxButton(ID_START_REMEDIATION_BUTTON, createStringResource("PageCertCampaign.button.startRemediation")) {
@Override
public void onClick(AjaxRequestTarget target) {
executeCampaignStateOperation(target, OP_START_REMEDIATION);
}
};
startRemediationButton.add(new VisibleEnableBehaviour() {
@Override
public boolean isVisible() {
return campaignModel.getObject().getState() == AccessCertificationCampaignStateType.REVIEW_STAGE_DONE && campaignModel.getObject().getCurrentStageNumber() == campaignModel.getObject().getNumberOfStages();
}
});
mainForm.add(startRemediationButton);
// TODO reenable when confirmation window is implemented
// AjaxButton closeCampaignButton = new AjaxButton(ID_CLOSE_CAMPAIGN_BUTTON,
// createStringResource("PageCertCampaign.button.closeCampaign")) {
//
// @Override
// public void onClick(AjaxRequestTarget target) {
// executeCampaignStateOperation(target, OP_CLOSE_CAMPAIGN);
// }
// };
// closeCampaignButton.add(new VisibleEnableBehaviour() {
// @Override
// public boolean isVisible() {
// return campaignModel.getObject().getState() != AccessCertificationCampaignStateType.CLOSED;
// }
// });
// mainForm.add(closeCampaignButton);
}
use of com.evolveum.midpoint.web.component.AjaxSubmitButton in project midpoint by Evolveum.
the class PageSecurityQuestions method initButtons.
private void initButtons(MidpointForm form) {
WebMarkupContainer firstLevelButtonContainer = new WebMarkupContainer(ID_FIRST_LEVEL_BUTTONS);
firstLevelButtonContainer.setOutputMarkupId(true);
firstLevelButtonContainer.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return !showedQuestions;
}
});
form.add(firstLevelButtonContainer);
AjaxSubmitButton showQuestion = new AjaxSubmitButton(ID_SHOW_QUESTIONS_BUTTON) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
showQuestions(target);
}
};
firstLevelButtonContainer.add(showQuestion);
firstLevelButtonContainer.add(createBackButton(ID_BACK_1_BUTTON));
}
Aggregations