Thanks alot.

The getResetPassword() did it.

I am doing a trivial application so i have not encrypted the password. May
be in a real application i will present a window for resetting password and
a separate window for editing the rest of the user details.

Regards.

On Wed, Jan 27, 2010 at 5:34 PM, Jonas <barney...@gmail.com> wrote:

> Not sure if that is actually the problem, but have you noticed
> PasswordTextField#getResetPassword() ?
> Its default value is 'true', meaning the value is cleared on every
> rendering.
>
> cheers,
> Jonas
>
> On Wed, Jan 27, 2010 at 3:19 PM, Josh Kamau <joshnet2...@gmail.com> wrote:
> >  I have would like to edit an existing user's properties including the
> > password. However, all the other properties are appearing on their
> > corresponding fields except the password field. How do i make it appear?.
> >
> >   here is my component for editing users
> >
> >
> >   public class UserPanel extends Panel {
> >
> >    /**
> >     *
> >     */
> >    private static final long serialVersionUID = 3819937222116190372L;
> >
> >    @Inject
> >    private UserDao userDao;
> >
> >    private TextField<String> txtUsername;
> >
> >    private PasswordTextField txtPassword;
> >
> >    private PasswordTextField txtConfPassword;
> >
> >    private User user;
> >
> >    public UserPanel(String id, final User user) {
> >        super(id);
> >
> >        this.user = user;
> >
> >        Form<User> frmCreateUser = new Form<User>("frmCreateUser") {
> >
> >            /**
> >             *
> >             */
> >            private static final long serialVersionUID = 1L;
> >
> >            @Override
> >            protected void onSubmit() {
> >                if (user.getId() == null) {
> >                    Long id = userDao.saveUser(this.getModelObject());
> >                    info("User #" + id + " has been created");
> >                } else {
> >                    Long id = userDao.updateUser(this.getModelObject());
> >                    info("User #" + id + " has been updated");
> >                }
> >            }
> >
> >        };
> >
> >        frmCreateUser.setModel(new Model<User>(user));
> >        add(frmCreateUser);
> >
> >        txtUsername = new TextField<String>("txtUsername",
> >                new PropertyModel<String>(user, "username"));
> >        txtPassword = new PasswordTextField("txtPassword",
> >                new PropertyModel<String>(user, "password"));
> >        txtConfPassword = new PasswordTextField("txtConfPassword",
> >                new PropertyModel<String>(user, "password"));
> >
> >
> >        frmCreateUser.add(txtUsername);
> >        frmCreateUser.add(txtPassword);
> >        frmCreateUser.add(txtConfPassword);
> >    }
> >
> >   the txtPassword and txtConfPassword fields display empty and so i have
> to
> > provide a password every time i edit the user.
> >
> >  Kindly help
> >
> > Regards
> >
> >  Josh
> >
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
> For additional commands, e-mail: users-h...@wicket.apache.org
>
>

Reply via email to