Search in sources :

Example 6 with PasswordPanel

use of com.evolveum.midpoint.gui.api.component.password.PasswordPanel in project midpoint by Evolveum.

the class PageSelfRegistration method createPasswordPanel.

private void createPasswordPanel(WebMarkupContainer staticRegistrationForm) {
    // ProtectedStringType initialPassword = null;
    PasswordPanel password = new PasswordPanel(ID_PASSWORD, new PropertyModel<>(getUserModel(), "credentials.password.value"), false, true, null, this);
    password.getBaseFormComponent().add(new EmptyOnBlurAjaxFormUpdatingBehaviour());
    password.getBaseFormComponent().setRequired(true);
    staticRegistrationForm.add(password);
    Label help = new Label(ID_TOOLTIP);
    final StringResourceModel tooltipText = createStringResource("PageSelfRegistration.password.policy");
    help.add(AttributeModifier.replace("title", tooltipText));
    help.add(new InfoTooltipBehavior());
    help.add(new VisibleEnableBehaviour() {

        private static final long serialVersionUID = 1L;

        @Override
        public boolean isVisible() {
            return StringUtils.isNotEmpty(tooltipText.getObject());
        }
    });
    staticRegistrationForm.add(help);
}
Also used : InfoTooltipBehavior(com.evolveum.midpoint.web.util.InfoTooltipBehavior) PasswordPanel(com.evolveum.midpoint.gui.api.component.password.PasswordPanel) EmptyOnBlurAjaxFormUpdatingBehaviour(com.evolveum.midpoint.web.page.admin.configuration.component.EmptyOnBlurAjaxFormUpdatingBehaviour) MultiLineLabel(org.apache.wicket.markup.html.basic.MultiLineLabel) Label(org.apache.wicket.markup.html.basic.Label) VisibleEnableBehaviour(com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour) StringResourceModel(org.apache.wicket.model.StringResourceModel)

Aggregations

PasswordPanel (com.evolveum.midpoint.gui.api.component.password.PasswordPanel)6 AjaxRequestTarget (org.apache.wicket.ajax.AjaxRequestTarget)4 Label (org.apache.wicket.markup.html.basic.Label)4 PropertyModel (org.apache.wicket.model.PropertyModel)4 VisibleEnableBehaviour (com.evolveum.midpoint.web.component.util.VisibleEnableBehaviour)3 ArrayList (java.util.ArrayList)3 IColumn (org.apache.wicket.extensions.markup.html.repeater.data.table.IColumn)3 GetOperationOptions (com.evolveum.midpoint.schema.GetOperationOptions)2 SelectorOptions (com.evolveum.midpoint.schema.SelectorOptions)2 OperationResult (com.evolveum.midpoint.schema.result.OperationResult)2 Task (com.evolveum.midpoint.task.api.Task)2 TablePanel (com.evolveum.midpoint.web.component.data.TablePanel)2 InputPanel (com.evolveum.midpoint.web.component.prism.InputPanel)2 ListDataProvider (com.evolveum.midpoint.web.component.util.ListDataProvider)2 MyPasswordsDto (com.evolveum.midpoint.web.page.admin.home.dto.MyPasswordsDto)2 PasswordAccountDto (com.evolveum.midpoint.web.page.admin.home.dto.PasswordAccountDto)2 AttributeModifier (org.apache.wicket.AttributeModifier)2 WebMarkupContainer (org.apache.wicket.markup.html.WebMarkupContainer)2 PasswordTextField (org.apache.wicket.markup.html.form.PasswordTextField)2 IModel (org.apache.wicket.model.IModel)2