See Also | Tutorials
You can drag the Password Field component
from
the Palette's Basic category to the Visual Designer to create a component for which the input entered is obscured (all
the characters are stars or bullets). The text the user enters (the component's
password property) is not obscured or encrypted over the network
or on the server in any way; it is just not displayed on the
screen in the web browser.
After adding a password field to a page, you can do a number
of things with it:
- Select the component and edit its properties in the Password Field Component Properties Window. Some typical
properties to edit are:
- id. The name of the component. In the JSP file,
this name is the value of the component's id
attribute. In the page bean, this property's value is
the name of the PasswordField object.
- label. A label describing the field, such as
Enter Your Password.
- Note: The
label property is not as flexible as the Label component. You can use the Label component if you want more control over aspects of the label's appearance, such as positioning of the label relative to the component.
- columns. The width in characters of the text field.
If the user types more characters than will fit, the field scrolls horizontally.
- password. The password entered by the user, which is sent to the server. You can bind this property to an object or a data provider representing a database field, web service, or enterprise bean that receives the value. If you provide a value for this property, the password field displays initially with an asterisk or bullet for each letter.
- Right-click the component and choose one of the following
pop-up menu items:
- Set Initial Focus. Gives this component focus when the user opens the page, and provides an edit cursor in the field.
- Edit Event Handler. Write code for one of the
following event handlers.
- validate. Opens the Java Editor with the
cursor positioned in the component's validate
method so you can insert code to validate the value
of the component.
- processValueChange. Opens the Java Editor
with the cursor positioned in the component's processValueChange
method so you can insert code that executes when the
value of this component changes (for example, the
user changes the value of another component that is
controlling the value of this component)
- Bind to Data. Opens a dialog box that enables
you to bind the component's
password property to a data provider or an object. For more information, see Bind to Data Dialog Box.
- Auto-submit on Change. Causes the form to be automatically submitted if the value of the component changes. Sets the component's JavaScript onclick property to
common_timeoutSubmitForm(this.form, 'component-id');. At runtime, this code causes the form to be automatically submitted if the user changes the component value. Once the form is submitted, conversion and validation occur on the server and any value change listener methods execute, and then the page is redisplayed.
A component configured to Auto-submit on Change can use virtual forms to limit the input fields that are processed when the form is submitted. If the auto-submit component is defined to submit a virtual form, only the participants in that virtual form will be processed when the auto-submit occurs.
- Property Bindings. Opens a dialog box that enables
you to bind properties of the component in addition to the
password property to other objects
or bean properties that update this component's properties
automatically.
- See Also
- Binding Component Properties
- Working
With Components
- Component
Tasks: Quick Reference
- Component
Web Tutorials
- Data
Source Web Tutorials
- About the Palette
- Tutorials
- Delving Into Components Tutorial
-
Using Virtual Forms