Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8642127
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T11:41:56+00:00 2026-06-12T11:41:56+00:00

I have a password confirmation component. The user can enter the two passwords manually

  • 0

I have a password confirmation component. The user can enter the two passwords manually or can generate a pair. The generated passwords are shown in a select list. When a password is selected from the list, the two input passwords should be updated with this password. The problem is that the input password doesn’t reflect the change after a password was selected.

password confirmation component:

<ui:composition xmlns="http://www.w3.org/1999/xhtml"
    xmlns:ui="http://java.sun.com/jsf/facelets"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:p="http://primefaces.org/ui">

    <h:outputText value="#{eval.getString(name)}: #{mandatory ? '*' : ''}"/>   
    <h:panelGrid columns="3">               
        <h:column>
            <p:password id="psw1"
                value="#{eval.evaluateAsBean(beanName).password}" feedback="false"
                disabled="#{not enabled}" />
        </h:column>
        <h:column>
            <p:commandButton value="#{label.create}" disabled="#{not enabled}"
                action="#{eval.evaluateAsBean(beanName).generate}"
                update="generated">
            </p:commandButton>
        </h:column>
        <h:column>
            <p:selectOneMenu id="generated"
                disabled="#{not enabled}"
                value="#{eval.evaluateAsBean(beanName).selectedPassword}">
                <f:selectItems value="#{eval.evaluateAsBean(beanName).passwords}"
                    var="val" itemLabel="#{val}" itemValue="#{val}" />
                    <p:ajax listener="#{eval.evaluateAsBean(beanName).passwordChanged}"
                        update="psw1, psw2" />
            </p:selectOneMenu>
        </h:column>
        <h:column>
            <p:password id="psw2"
                value="#{eval.evaluateAsBean(beanName).confirmedPassword}"
                feedback="false" disabled="#{not enabled}" />
        </h:column>
        <h:column>
            <h:outputText value="" />
        </h:column>
        <h:column>
            <h:outputText value="" />
        </h:column>
    </h:panelGrid>
</ui:composition>

passwordChanged listener:

public void passwordChanged() {
    this.password = selectedPassword;
    this.confirmedPassword = selectedPassword;
}

Edit1

I have removed the update attribute from p:ajax and changed passwordChanged listener to:

public void passwordChanged() {
    this.password = selectedPassword;
    this.confirmedPassword = selectedPassword;
    RequestContext.getCurrentInstance().update("form:tabs:editorsGroup:editor:psw1");
    RequestContext.getCurrentInstance().update("form:tabs:editorsGroup:editor:psw2");
}

With Firebug the id of psw1 is: form:tabs:9:editorsGroup:4:editor27:psw1. Still doesn’t work.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T11:41:57+00:00Added an answer on June 12, 2026 at 11:41 am

    For obvious security reasons, the <p:password> (and <h:inputSecret>) do by default not redisplay the value from the model.

    To turn off this security feature, set redisplay="true" (this applies to <h:inputSecret> as well).

    <p:password ... redisplay="true" />
    

    See also:

    • Setting the value for jsf InputSecret during page load from the managed bean
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two models, user and treating (which you can think of as a
I have two model like so class User < ActiveRecord::Base attr_accessible :email, :password, :password_confirmation,
I have the password field on page. I want to display text Enter password
Is it possible to have AuthLogic validate a password confirmation if present, but otherwise
I have model User class User < ActiveRecord::Base has_and_belongs_to_many :roles attr_accessible :login, :email, :password,
I have a custom controller that handles the editing of user passwords based off
I have this code ... recipient = User.find_or_create_by_email(params[:recipient_email], { :password => 'password', :password_confirmation =>
I have these classes: class User has_one :user_profile accepts_nested_attributes_for :user_profile attr_accessible :email, :password, :password_confirmation,
I have the following factory: factory :user do name 'Henk' email 'foo@bar.co' password 'foobar'
I have a User model that acts_as_authentic for AuthLogic's password management. AuthLogic adds password

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.