Example usage for org.apache.wicket.markup.html.form PasswordTextField PasswordTextField

List of usage examples for org.apache.wicket.markup.html.form PasswordTextField PasswordTextField

Introduction

In this page you can find the example usage for org.apache.wicket.markup.html.form PasswordTextField PasswordTextField.

Prototype

public PasswordTextField(final String id) 

Source Link

Usage

From source file:au.org.theark.study.web.component.manageuser.form.DetailForm.java

License:Open Source License

@SuppressWarnings("unchecked")
public void initialiseDetailForm() {
    userNameTxtField = new TextField<String>(Constants.USER_NAME);
    userNameTxtField.setOutputMarkupId(true);
    firstNameTxtField = new TextField<String>(Constants.FIRST_NAME);
    lastNameTxtField = new TextField<String>(Constants.LAST_NAME);
    emailTxtField = new TextField<String>(Constants.EMAIL);
    userPasswordField = new PasswordTextField(Constants.PASSWORD);
    confirmPasswordField = new PasswordTextField(Constants.CONFIRM_PASSWORD);
    oldPasswordField = new PasswordTextField(Constants.OLD_PASSWORD);
    groupPasswordContainer = new WebMarkupContainer("groupPasswordContainer");

    IModel<List<ArkUserRole>> iModel = new LoadableDetachableModel() {
        private static final long serialVersionUID = 1L;

        @Override/*from  w ww. j  a v  a2  s.co m*/
        protected Object load() {
            return containerForm.getModelObject().getArkUserRoleList();
        }
    };

    ListView listView = new ListView("arkUserRoleList", iModel) {

        private static final long serialVersionUID = 1L;

        @Override
        protected void populateItem(ListItem item) {
            // Each item will be ArkModuleVO use that to build the Module name and the drop down
            ArkUserRole arkUserRole = (ArkUserRole) item.getModelObject();
            ArkModule arkModule = arkUserRole.getArkModule();
            // Acts as the data source for ArkRoles
            ArrayList<ArkRole> arkRoleSourceList = iArkCommonService.getArkRoleLinkedToModule(arkModule);
            if (arkUserRole.getArkUser() == null
                    && arkModule.getName().equalsIgnoreCase(au.org.theark.core.Constants.ARK_MODULE_STUDY)) {
                // If the ArkUserRole is not assigned and the module is Study then set the default Role
                ArkRole arkRole = iArkCommonService
                        .getArkRoleByName(au.org.theark.core.Constants.ARK_STUDY_DEFAULT_ROLE);
                arkUserRole.setArkRole(arkRole);
            }

            PropertyModel arkUserRolePm = new PropertyModel(arkUserRole, "arkRole");
            ChoiceRenderer<ArkRole> defaultChoiceRenderer = new ChoiceRenderer<ArkRole>(Constants.NAME, "id");

            DropDownChoice<ArkRole> ddc = new DropDownChoice<ArkRole>("arkRole", arkUserRolePm,
                    arkRoleSourceList, defaultChoiceRenderer);

            item.add(new Label("moduleName", arkModule.getName()));// arkModule within ArkUserRole
            item.add(ddc);

        }
    };

    listView.setReuseItems(true);
    arkCrudContainerVO.getWmcForarkUserAccountPanel().add(listView);
    confirmationAnswer = new ConfirmationAnswer(false);
    confirmModal = new ModalWindow("modalWindow");
    confirmModal.setCookieName("yesNoPanel");
    confirmModal.setContent(
            new YesNoPanel(confirmModal.getContentId(), modalText, confirmModal, confirmationAnswer));
    confirmModal.setWindowClosedCallback(new ModalWindow.WindowClosedCallback() {
        private static final long serialVersionUID = 1L;

        public void onClose(AjaxRequestTarget target) {
            if (confirmationAnswer.isAnswer()) {
                //Add new roles for module wise to study
                iUserService.updateArkUserRoleListForExsistingUser(containerForm.getModelObject());
                //Up date for all the child studies.
                reNewArkUserRoleForChildStudies(containerForm);
                containerForm.getModelObject().setMode(Constants.MODE_EDIT);
                //onSavePostProcess(target);
                successModal.show(target);
            } else {//if no nothing be done.Just close I guess
            }
        }
    });
    successModal = new ModalWindow("successModalWindow");
    successModal.setCookieName("okPanel");
    successModal.setContent(new SuccessFullySaved(confirmModal.getContentId(),
            "The exsisting user added sucessfully to the Study", successModal));
    initChildStudyPalette();
    attachValidators();
    addDetailFormComponents();

}

From source file:by.grodno.ss.rentacar.webapp.page.register.RegisterPanel.java

@Override
protected void onInitialize() {
    super.onInitialize();
    Form<UserCredentials> form = new Form<UserCredentials>("form-register",
            new CompoundPropertyModel<UserCredentials>(userCredentials));
    form.add(new FeedbackPanel("feedbackpanel"));

    TextField<String> email = new TextField<String>("email");
    email.setRequired(true);// www. j a v a2 s  .  c o m
    email.add(StringValidator.maximumLength(100));
    email.add(StringValidator.minimumLength(3));
    email.add(EmailAddressValidator.getInstance());
    form.add(email);

    PasswordTextField password = new PasswordTextField("password");
    password.setRequired(true);
    password.add(StringValidator.maximumLength(100));
    password.add(StringValidator.minimumLength(6));
    password.add(new PatternValidator("[A-Za-z0-9_-]+"));
    form.add(password);

    TextField<String> firstName = new TextField<String>("firstName",
            new PropertyModel<>(userProfile, "firstName"));
    firstName.setRequired(true);
    firstName.add(StringValidator.maximumLength(100));
    firstName.add(StringValidator.minimumLength(2));
    firstName.add(new PatternValidator("[A-Za-z]+"));
    form.add(firstName);

    TextField<String> lastName = new TextField<String>("lastName",
            new PropertyModel<>(userProfile, "lastName"));
    lastName.setRequired(true);
    lastName.add(StringValidator.maximumLength(100));
    lastName.add(StringValidator.minimumLength(2));
    firstName.add(new PatternValidator("[A-Za-z]+"));
    form.add(lastName);

    TextField<String> phone = new TextField<String>("phone", new PropertyModel<>(userProfile, "phoneNumber"));
    phone.setRequired(true);
    phone.add(StringValidator.maximumLength(100));
    phone.add(StringValidator.minimumLength(2));
    phone.add(new PatternValidator("[0-9+()-]+"));
    form.add(phone);

    DateTextFieldConfig config = new DateTextFieldConfig();
    config.withLanguage(AuthorizedSession.get().getLocale().getLanguage());
    config.withFormat("dd.MM.yyyy");
    DateTextField dateBirth = new DateTextField("date-birth", new PropertyModel<>(userProfile, "birthDay"),
            config);
    form.add(dateBirth);

    TextField<String> licNumber = new TextField<String>("lic-number",
            new PropertyModel<>(userProfile, "licenseNumber"));
    licNumber.add(StringValidator.maximumLength(100));
    licNumber.add(StringValidator.minimumLength(2));
    licNumber.add(new PatternValidator("[A-Za-z0-9]+"));
    form.add(licNumber);

    TextField<String> address = new TextField<String>("address", new PropertyModel<>(userProfile, "address"));
    address.add(StringValidator.maximumLength(100));
    address.add(StringValidator.minimumLength(2));
    address.add(new PatternValidator("[A-Za-z0-9 /-]+"));
    form.add(address);

    TextField<String> city = new TextField<String>("city", new PropertyModel<>(userProfile, "city"));
    city.add(StringValidator.maximumLength(100));
    city.add(StringValidator.minimumLength(2));
    city.add(new PatternValidator("[A-Za-z0-9]+"));
    form.add(city);

    TextField<String> region = new TextField<String>("region", new PropertyModel<>(userProfile, "region"));
    region.add(StringValidator.maximumLength(100));
    region.add(StringValidator.minimumLength(2));
    region.add(new PatternValidator("[A-Za-z0-9]+"));
    form.add(region);

    TextField<String> zip = new TextField<String>("zip-code", new PropertyModel<>(userProfile, "zipCode"));
    zip.add(StringValidator.maximumLength(20));
    zip.add(StringValidator.minimumLength(2));
    zip.add(new PatternValidator("[0-9]+"));
    form.add(zip);

    BootstrapCheckBoxPicker chk0 = new BootstrapCheckBoxPicker("check-confirm", Model.of(Boolean.FALSE));
    form.add(chk0);

    form.add(new SubmitLink("button-register") {
        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit() {
            if (chk0.getModelObject().equals(false)) {
                info("You must to agree rental terms");
            } else {
                userCredentials.setRole(UserRole.CLIENT);
                if (userProfile.getId() == null) {
                    userService.register(userProfile, userCredentials);
                } else {
                    userService.update(userProfile);
                    userService.update(userCredentials);
                }
                setResponsePage(new LoginPage());
            }
        }
    });
    add(form);

}

From source file:ca.travelagency.identity.SystemUserPage.java

License:Apache License

private void addPasswordFields(Form<SystemUser> form) {
    boolean systemUserExist = DaoEntityModelFactory.isPersisted(form.getModelObject());

    PasswordTextField passwordField = new PasswordTextField(SystemUser.Properties.password.name());
    form.add(passwordField);//  www.j  a  v  a2 s. co m

    PasswordTextField confirmPasswordField = new PasswordTextField(CONFIRM_PASSWORD, new Model<String>());
    form.add(confirmPasswordField);

    if (systemUserExist) {
        passwordField.setVisible(false);
        confirmPasswordField.setVisible(false);
        return;
    }

    passwordField.setLabel(new ResourceModel("password")).add(new FieldDecorator());
    confirmPasswordField.setLabel(new ResourceModel("confirmPassword")).add(new FieldDecorator());
    form.add(new EqualPasswordInputValidator(passwordField, confirmPasswordField));
}

From source file:com.example.justaddwater.components.LoginForm.java

License:Apache License

public LoginForm(String id) {
    super(id);//from   w  w w .  j  a v a 2 s  . c  om

    add(new TextField("username").setRequired(true));
    add(new PasswordTextField("password").setRequired(true));
    add(new ExternalLink("loginWithFacebook", FacebookOAuthPage.getFacebookLoginUrl()));
}

From source file:com.romeikat.datamessie.core.base.ui.page.SignInPage.java

License:Open Source License

@Override
protected void onInitialize() {
    super.onInitialize();

    // Signin page sould be stateless
    setStatelessHint(true);/*  w  w w  .  ja  va2s .c  o  m*/

    // Form
    final StatelessForm<Void> form = new StatelessForm<Void>("signInForm") {
        private static final long serialVersionUID = 1L;

        @Override
        protected void onSubmit() {
            if (Strings.isEmpty(username)) {
                return;
            }
            // Authenticate
            final boolean authResult = AuthenticatedWebSession.get().signIn(username, password);
            // If authentication succeeds, redirect user to the requested page
            if (authResult) {
                continueToOriginalDestination();
                // If we reach this line there was no intercept page, so go to home page
                setResponsePage(getApplication().getHomePage());
            }
        }
    };
    form.setDefaultModel(new CompoundPropertyModel<SignInPage>(this));
    add(form);

    // Username
    final TextField<String> usernameTextField = new TextField<String>("username");
    usernameTextField.add(new FocusBehavior());
    form.add(usernameTextField);
    // Password
    final PasswordTextField passwordTextField = new PasswordTextField("password");
    form.add(passwordTextField);
}

From source file:com.senacor.wbs.web.user.CreateUserSimplePage.java

License:Apache License

public CreateUserSimplePage() {
    Form form = new Form("userform", new CompoundPropertyModel(user)) {
        @Override/*  w  ww  .ja va2 s . c o m*/
        protected void onSubmit() {
            System.out.println("submit!");
            System.out.println(user);
        }
    };
    form.add(new TextField("username"));
    form.add(new TextField("mainContact.email"));
    form.add(new PasswordTextField("passwort"));
    form.add(new PasswordTextField("passwort2"));
    form.add(new Button("submit"));
    this.add(form);
}

From source file:com.senacor.wbs.web.user.UserPasswordPanel.java

License:Apache License

public UserPasswordPanel(String id, final boolean showButton) {
    super(id);/* w w  w . j a v a 2s.  c om*/
    setOutputMarkupId(true);
    Form form = new Form("passwordform") {
        @Override
        protected void onSubmit() {
            UserPasswordPanel.this.onSubmit();
        }
    };
    form.add(new PasswordTextField("passwort"));
    form.add(new PasswordTextField("passwort2"));
    form.add(new Button("submit") {
        @Override
        public boolean isVisible() {
            return showButton;
        }
    });
    this.add(form);
}

From source file:com.userweave.pages.registration.RegisterFormPanel.java

License:Open Source License

public RegisterFormPanel(String id) {
    super(id);//from  w w w . j ava 2s .c o  m

    checked = false;

    // Add a FeedbackPanel for displaying our messages
    FeedbackPanel feedbackPanel = new FeedbackPanel("feedback");

    setDefaultModel(new CompoundPropertyModel(RegisterFormPanel.this));

    Form<Void> form = new Form<Void>("form") {
        @Override
        protected void onSubmit() {
            User user = userService.createUser(email, getSession().getLocale());

            user.setForename(forename);

            user.setSurname(lastname);

            user.setPasswordMD5(password);

            user.setVerified(false);

            userDao.save(user);

            userService.sendRegisterMail(email, getSession().getLocale(), new MailMessageProviderImpl(this) {

                @Override
                public String getMailSubject() {
                    return new StringResourceModel("mail_subject", RegisterFormPanel.this, null).getString();
                }

                @Override
                public String getMailMessage(final String urlStr) {
                    return new StringResourceModel("mail_message", RegisterFormPanel.this, null,
                            new Object[] { email, urlStr }).getString();
                }
            });

            onAfterSubmit();
        }
    };

    add(form);

    form.add(new TextField<String>("forename").setRequired(true)
            .setLabel(new Model(new StringResourceModel("name", RegisterFormPanel.this, null).getString())));

    form.add(new TextField<String>("lastname").setRequired(true)
            .setLabel(new Model(new StringResourceModel("surname", RegisterFormPanel.this, null).getString())));

    form.add(new TextField<String>("email").setRequired(true)
            .setLabel(new Model(new StringResourceModel("mail", RegisterFormPanel.this, null).getString())));

    form.add(new PasswordTextField("password").setLabel(
            new Model(new StringResourceModel("password", RegisterFormPanel.this, null).getString())));

    form.add(new CheckBox("checked").setRequired(true));

    form.add(feedbackPanel);

}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.home.HomeLoginForm.java

License:Apache License

public HomeLoginForm(String id) {
    super(id, new CompoundPropertyModel<LoginUserDTO>(new LoginUserDTO()));

    TextField<String> userName = new TextField<String>("userName");
    userName.setRequired(true);//from   w  ww.  jav  a 2 s. c o m

    add(userName);

    PasswordTextField password = new PasswordTextField("password");
    password.setRequired(true);

    add(password);

    Button submit = new Button("submit", ResourceUtils.getModel("action.login")) {

        private static final long serialVersionUID = 1L;

        @Override
        public void onSubmit() {
            LoginUserDTO object = HomeLoginForm.this.getModelObject();
            if (EEGDataBaseSession.get().signIn(object.getUserName().toLowerCase(), object.getPassword())) {
                continueToOriginalDestination();
                setResponsePage(WelcomePage.class);

            } else {
                error("User cannot be log in.");
            }
        }
    };
    add(submit);
}

From source file:cz.zcu.kiv.eegdatabase.wui.ui.security.RegistrationForm.java

License:Apache License

public RegistrationForm(String id, final FeedbackPanel feedback) throws IOException {
    super(id, new CompoundPropertyModel<PersonFormObject>(new PersonFormObject()));

    EmailTextField email = new EmailTextField("email");
    email.setLabel(ResourceUtils.getModel("general.email"));
    email.setRequired(true);/*from w ww .ja  va  2  s  .  c o m*/
    add(email);

    PasswordTextField password = new PasswordTextField("password");
    password.setLabel(ResourceUtils.getModel("general.password"));
    password.setRequired(true);
    password.add(StringValidator.minimumLength(6));
    add(password);

    PasswordTextField passwordVerify = new PasswordTextField("passwordVerify");
    passwordVerify.setLabel(ResourceUtils.getModel("general.password.verify"));
    passwordVerify.setRequired(true);
    passwordVerify.add(StringValidator.minimumLength(6));
    add(passwordVerify);

    add(panelPerson = new PersonFormPanel<FullPersonDTO>("panelPerson",
            new CompoundPropertyModel<FullPersonDTO>(new FullPersonDTO()), educationLevelFacade));

    //        TextField<String> name = new TextField<String>("name");
    //        name.setLabel(ResourceUtils.getModel("general.name"));
    //        name.setRequired(true);
    //        name.add(new PatternValidator(StringUtils.REGEX_ONLY_LETTERS));
    //        add(name);
    //
    //        TextField<String> surname = new TextField<String>("surname");
    //        surname.setLabel(ResourceUtils.getModel("general.surname"));
    //        surname.setRequired(true);
    //        surname.add(new PatternValidator(StringUtils.REGEX_ONLY_LETTERS));
    //        add(surname);
    //
    //        DateTimeFieldPicker date = new DateTimeFieldPicker("dateOfBirth") {
    //
    //            private static final long serialVersionUID = 1L;
    //
    //            @Override
    //            public <C> IConverter<C> getConverter(Class<C> type) {
    //                return (IConverter<C>) new TimestampConverter();
    //            }
    //        };
    //        date.setLabel(ResourceUtils.getModel("general.dateofbirth"));
    //        //date.setRequired(true);
    //        add(date);
    //
    //
    //        TextField<String> address = new TextField<String>("address");
    //        address.setLabel(ResourceUtils.getModel("label.address"));
    //        add(address);
    //
    //        TextField<String> city = new TextField<String>("city");
    //        city.setLabel(ResourceUtils.getModel("label.city"));
    //        add(city);
    //
    //        TextField<String> state = new TextField<String>("state");
    //        state.setLabel(ResourceUtils.getModel("label.state"));
    //        add(state);
    //
    //        TextField<String> zipCode = new TextField<String>("zipCode");
    //        zipCode.setLabel(ResourceUtils.getModel("label.zipCode"));
    //        add(zipCode);
    //
    //        TextField<String> url = new TextField<String>("url");
    //        url.setLabel(ResourceUtils.getModel("label.url"));
    //        add(url);
    //
    //        TextField<String> phone = new TextField<String>("phone");
    //        phone.setLabel(ResourceUtils.getModel("label.phoneNumber"));
    //        add(phone);
    //
    //        TextField<String> organization = new TextField<String>("organization");
    //        organization.setLabel(ResourceUtils.getModel("label.organization"));
    //        add(organization);
    //
    //        TextField<String> jobTitle = new TextField<String>("jobTitle");
    //        jobTitle.setLabel(ResourceUtils.getModel("label.jobTitle"));
    //        add(jobTitle);
    //
    //        TextField<String> orgAddress = new TextField<String>("orgAddress");
    //        orgAddress.setLabel(ResourceUtils.getModel("label.address"));
    //        add(orgAddress);
    //
    //        TextField<String> orgCity = new TextField<String>("orgCity");
    //        orgCity.setLabel(ResourceUtils.getModel("label.city"));
    //        add(orgCity);
    //
    //        TextField<String> orgState = new TextField<String>("orgState");
    //        orgState.setLabel(ResourceUtils.getModel("label.state"));
    //        add(orgState);
    //
    //        TextField<String> orgZipCode = new TextField<String>("orgZipCode");
    //        orgZipCode.setLabel(ResourceUtils.getModel("label.zipCode"));
    //        add(orgZipCode);
    //
    //        TextField<String> orgUrl = new TextField<String>("orgUrl");
    //        orgUrl.setLabel(ResourceUtils.getModel("label.url"));
    //        add(orgUrl);
    //
    //        TextField<String> orgPhone = new TextField<String>("orgPhone");
    //        orgPhone.setLabel(ResourceUtils.getModel("label.phoneNumber"));
    //        add(orgPhone);
    //
    //        TextField<String> VAT = new TextField<String>("VAT");
    //        VAT.setLabel(ResourceUtils.getModel("label.VAT"));
    //        add(VAT);

    generateCaptchaImageAndPrepareValidation();
    add(captchaImage);

    TextField<String> controlText = new TextField<String>("controlText");
    controlText.setLabel(ResourceUtils.getModel("general.controlText"));
    controlText.setRequired(true);
    add(controlText);

    //        RadioChoice<Gender> gender = new RadioChoice<Gender>("gender", Arrays.asList(Gender.values()), new EnumChoiceRenderer<Gender>());
    //        gender.setSuffix("\n");
    //        gender.setRequired(true);
    //        gender.setLabel(ResourceUtils.getModel("general.gender"));
    //        add(gender);

    //        List<String> listOfTitles = new ArrayList<String>();
    //        listOfTitles.add("Mr.");
    //        listOfTitles.add("Mrs.");
    //        listOfTitles.add("Ms.");
    //
    //        DropDownChoice<String> title = new DropDownChoice<String>("title", listOfTitles,
    //                new ChoiceRenderer<String>() {
    //
    //                    private static final long serialVersionUID = 1L;
    //
    //                    @Override
    //                    public Object getDisplayValue(String object) {
    //                        return object;
    //                    }
    //
    //                });
    //
    //        title.setRequired(true);
    //        title.setLabel(ResourceUtils.getModel("label.title"));
    //        add(title);
    //
    //        File file = ResourceUtils.getFile("countries.txt");
    //        List<String> countries = FileUtils.getFileLines(file);
    //
    //        DropDownChoice<String> country = new DropDownChoice<String>("country", countries,
    //                new ChoiceRenderer<String>("country") {
    //
    //                    private static final long serialVersionUID = 1L;
    //
    //                    @Override
    //                    public Object getDisplayValue(String object) {
    //                        return object;
    //                    }
    //
    //                });
    //
    //        country.setRequired(true);
    //        country.setLabel(ResourceUtils.getModel("label.country"));
    //        add(country);
    //
    //        DropDownChoice<String> orgCountry = new DropDownChoice<String>("orgCountry", countries,
    //                new ChoiceRenderer<String>("orgCountry") {
    //
    //                    private static final long serialVersionUID = 1L;
    //
    //                    @Override
    //                    public Object getDisplayValue(String object) {
    //                        return object;
    //                    }
    //
    //                });
    //
    //        //orgCountry.setRequired(true);
    //        orgCountry.setLabel(ResourceUtils.getModel("label.country"));
    //        add(orgCountry);
    //
    //        DropDownChoice<EducationLevel> educationLevel = new DropDownChoice<EducationLevel>("educationLevel", educationLevelFacade.getAllRecords(),
    //                new ChoiceRenderer<EducationLevel>("title", "educationLevelId") {
    //
    //                    private static final long serialVersionUID = 1L;
    //
    //                    @Override
    //                    public Object getDisplayValue(EducationLevel object) {
    //                        return object.getEducationLevelId() + " " + super.getDisplayValue(object);
    //                    }
    //
    //                });
    //
    //        educationLevel.setLabel(ResourceUtils.getModel("general.educationlevel"));
    //        add(educationLevel);
    //
    //        List<String> listOfOrgTypes = new ArrayList<String>();
    //        listOfOrgTypes.add("Commercial");
    //        listOfOrgTypes.add("Non-Commercial");
    //
    //        DropDownChoice<String> organizationType = new DropDownChoice<String>("organizationType", listOfOrgTypes,
    //                new ChoiceRenderer<String>("organizationType") {
    //
    //                    private static final long serialVersionUID = 1L;
    //
    //                    @Override
    //                    public Object getDisplayValue(String object) {
    //                        return object;
    //                    }
    //
    //                });
    //
    //        organizationType.setRequired(true);
    //        organizationType.setLabel(ResourceUtils.getModel("label.organizationType"));
    //        add(organizationType);

    SubmitLink submit = new SubmitLink("submit", ResourceUtils.getModel("action.create.account")) {

        private static final long serialVersionUID = 1L;

        //            @Override
        //            protected void onError(AjaxRequestTarget target, Form<?> form) {
        //                target.add(feedback);
        //            }

        @Override
        public void onSubmit() {

            PersonFormObject user = RegistrationForm.this.getModelObject();
            user.setPanelPerson(panelPerson.getModelObject());
            // validate captcha via service
            if (captchaService.validateResponseForID(user.getCaptcha(), user.getControlText())) {

                user.getPanelPerson().setRegistrationDate(new DateTime());
                if (validation(user)) {
                    personFacade.create(new PersonMapper().convertToEntity(user, new Person()));
                    setResponsePage(ConfirmPage.class,
                            PageParametersUtils.getPageParameters(ConfirmPage.EMAIL, user.getEmail()));
                }
                // if captcha is valid but other validation fail - generate new captcha
                generateCaptchaImageAndPrepareValidation();
            } else {
                error(ResourceUtils.getString("general.error.registration.captchaInvalid"));
                generateCaptchaImageAndPrepareValidation();
            }
            //target.add(captchaImage);
            //target.add(feedback);
        }
    };
    add(submit);
}