Thursday, February 9, 2012

Persist Passwords If You Prefer

I have been working this week on a user registration screen.  Seems simple enough but I needed two server-side validations when the user submits the XPage and then I discovered that the standard XPage password field controls empty their values if the XPage fails validation.

By changing the "redisplay" property to true, if the XPage fails validation for any field, the previously entered password values persist in the fields.

Forcing users to reenter the password post-validation-failure was unacceptable, password fields do not work with default values and this method is cleaner than trying to capture the values pre-submission and trying to reset their values from the client-side after the screen reloads.

NOTE: People using this screen in my application already know the passwords and only authenticated users ever use this XPage so I am comfortable with the level of security provided when enabling this property.