use of com.evolveum.midpoint.web.component.form.Form 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.form.Form in project midpoint by Evolveum.
the class TaskMainPanel method initLayout.
private void initLayout() {
Form mainForm = new Form<>(ID_MAIN_FORM, true);
add(mainForm);
initTabPanel(mainForm);
initButtons(mainForm);
}
use of com.evolveum.midpoint.web.component.form.Form in project midpoint by Evolveum.
the class MultipleAssignmentSelectorPanel method initLayout.
private void initLayout(Class<H> targetFocusClass, PageBase page) {
IModel<List<AssignmentEditorDto>> availableAssignmentModel = createAvailableAssignmentModel();
final MultipleAssignmentSelector availableAssignmentsPanel = new MultipleAssignmentSelector<F, H>(ID_AVAILABLE_ASSIGNMENTS, availableAssignmentModel, targetFocusClass, type, focus, getFilterModel(true), page);
final MultipleAssignmentSelector currentAssignmentsPanel = new MultipleAssignmentSelector<F, H>(ID_CURRENT_ASSIGNMENTS, assignmentsModel, targetFocusClass, type, null, getFilterModel(true), page) {
@Override
protected List<AssignmentEditorDto> getListProviderDataList() {
return assignmentsModel.getObject();
}
};
currentAssignmentsPanel.setFilterButtonVisibility(false);
AjaxButton add = new AjaxButton(ID_BUTTON_ADD) {
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form form) {
addToAssignmentsModel(target, availableAssignmentsPanel, currentAssignmentsPanel);
}
};
AjaxButton remove = new AjaxButton(ID_BUTTON_REMOVE) {
@Override
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form form) {
deleteFromAssignmentsModel(target, currentAssignmentsPanel, availableAssignmentsPanel);
}
};
remove.add(new VisibleEnableBehaviour() {
@Override
public boolean isEnabled() {
return WebComponentUtil.isAuthorized(AuthorizationConstants.AUTZ_UI_UNASSIGN_ACTION_URL);
}
});
AjaxLink<String> buttonReset = new AjaxLink<String>(ID_BUTTON_RESET) {
@Override
public void onClick(AjaxRequestTarget target) {
reset(currentAssignmentsPanel);
target.add(currentAssignmentsPanel);
}
};
buttonReset.setBody(createStringResource("MultipleAssignmentSelector.reset"));
Form<?> form = new Form<Void>(ID_FORM);
form.add(createTenantContainer());
form.add(createOrgContainer());
form.add(availableAssignmentsPanel);
form.add(currentAssignmentsPanel);
form.add(buttonReset);
form.add(add);
form.add(remove);
add(form);
}
use of com.evolveum.midpoint.web.component.form.Form in project midpoint by Evolveum.
the class PageSelfRegistration method updateCaptcha.
private void updateCaptcha(AjaxRequestTarget target) {
CaptchaPanel captcha = new CaptchaPanel(ID_CAPTCHA);
captcha.setOutputMarkupId(true);
Form<?> form = (Form<?>) get(ID_MAIN_FORM);
form.addOrReplace(captcha);
target.add(form);
}
use of com.evolveum.midpoint.web.component.form.Form in project midpoint by Evolveum.
the class PageSelfRegistration method initLayout.
private void initLayout() {
final Form<?> mainForm = new Form<>(ID_MAIN_FORM);
initAccessBehaviour(mainForm);
add(mainForm);
addMultilineLable(ID_WELCOME, "PageSelfRegistration.welcome.message", mainForm);
addMultilineLable(ID_ADDITIONAL_TEXT, "PageSelfRegistration.additional.message", mainForm);
initStaticFormLayout(mainForm);
initDynamicFormLayout(mainForm);
CaptchaPanel captcha = new CaptchaPanel(ID_CAPTCHA);
captcha.setOutputMarkupId(true);
mainForm.add(captcha);
AjaxSubmitButton register = new AjaxSubmitButton(ID_SUBMIT_REGISTRATION) {
private static final long serialVersionUID = 1L;
@Override
protected void onError(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
showErrors(target);
}
protected void onSubmit(AjaxRequestTarget target, org.apache.wicket.markup.html.form.Form<?> form) {
submitRegistration(target);
}
};
mainForm.add(register);
MultiLineLabel label = new MultiLineLabel(ID_REGISTRATION_SUBMITED, createStringResource("PageSelfRegistration.registration.confirm.message"));
add(label);
label.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return submited;
}
@Override
public boolean isEnabled() {
return submited;
}
});
AjaxButton back = new AjaxButton(ID_BACK) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
setResponsePage(PageLogin.class);
}
};
mainForm.add(back);
}
Aggregations