use of org.apache.wicket.markup.html.basic.MultiLineLabel 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);
}
use of org.apache.wicket.markup.html.basic.MultiLineLabel in project wicket by apache.
the class AjaxEditableMultiLineLabel method newLabel.
/**
* {@inheritDoc}
*/
@Override
protected MultiLineLabel newLabel(final MarkupContainer parent, final String componentId, final IModel<T> model) {
MultiLineLabel label = new MultiLineLabel(componentId, model) {
private static final long serialVersionUID = 1L;
/**
* {@inheritDoc}
*/
@Override
public void onComponentTagBody(final MarkupStream markupStream, final ComponentTag openTag) {
Object modelObject = getDefaultModelObject();
if ((modelObject == null) || "".equals(modelObject)) {
replaceComponentTagBody(markupStream, openTag, defaultNullLabel());
} else {
super.onComponentTagBody(markupStream, openTag);
}
}
};
label.setOutputMarkupId(true);
label.add(new LabelAjaxBehavior(getLabelAjaxEvent()));
return label;
}
use of org.apache.wicket.markup.html.basic.MultiLineLabel in project midpoint by Evolveum.
the class PageForgotPassword method initButtons.
private void initButtons(Form<?> form) {
AjaxSubmitButton submit = new AjaxSubmitButton(ID_SUBMIT, createStringResource("PageForgetPassword.resetPassword")) {
private static final long serialVersionUID = 1L;
@Override
protected void onSubmit(AjaxRequestTarget target) {
processResetPassword(target, form);
}
@Override
protected void onError(AjaxRequestTarget target) {
target.add(getFeedbackPanel());
}
};
submit.setOutputMarkupId(true);
form.add(submit);
form.setDefaultButton(submit);
AjaxButton backButton = new AjaxButton(ID_BACK, createStringResource("PageForgetPassword.back")) {
private static final long serialVersionUID = 1L;
@Override
public void onClick(AjaxRequestTarget target) {
setResponsePage(PageLogin.class);
}
};
backButton.setOutputMarkupId(true);
form.add(backButton);
add(form);
MultiLineLabel label = new MultiLineLabel(ID_PASSWORD_RESET_SUBMITED, createStringResource("PageForgotPassword.form.submited.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;
}
});
}
use of org.apache.wicket.markup.html.basic.MultiLineLabel in project midpoint by Evolveum.
the class PageSelfRegistration method addMultilineLable.
private void addMultilineLable(String id, String messageKey, Form<?> mainForm) {
MultiLineLabel welcome = new MultiLineLabel(id, createStringResource(messageKey));
welcome.setOutputMarkupId(true);
welcome.add(new VisibleEnableBehaviour() {
private static final long serialVersionUID = 1L;
@Override
public boolean isVisible() {
return !submited;
}
});
mainForm.add(welcome);
}
use of org.apache.wicket.markup.html.basic.MultiLineLabel in project midpoint by Evolveum.
the class PageSelfRegistration method addMultilineLable.
private void addMultilineLable(String id, StringResourceModel messageModel, WebMarkupContainer mainForm) {
MultiLineLabel welcome = new MultiLineLabel(id, messageModel);
welcome.setOutputMarkupId(true);
// welcome.add(new VisibleEnableBehaviour() {
// private static final long serialVersionUID = 1L;
//
// @Override
// public boolean isVisible() {
// return !submited;
// }
// });
mainForm.add(welcome);
}
Aggregations