You see the Properties window for a JavaServer Faces Button component when you select the component on a page that you are editing in the Visual Designer. Most of the component's properties are both JSP attributes and properties of the
HtmlCommandButton
Java component in the page bean.
This standard JavaServer Faces component has the following properties.
Type: text
type: String
alt
text for the button graphic. The alt text describes the graphic element in the HTML page, is readable by screen readers, can display as a tool tip, and displays when the user has display of images turned off in the web browser.
Type: boolean
Type: String
If you navigate to a file, select the file and click OK. You see the image displayed on your button. The image file is copied to the project, and you can see it in the Projects window under project-name > Web Pages > resources.
<input>
element's type
is image
and the button is a submit button that uses the specified image. type
specified in the Button Type property and the button's label (displayed text) specified in the value property. Type: boolean
Type: String
position: absolute; left: 288px; top: 312px
You can enter values directly or click the ellipsis (...) button to use the Style Editor.
For a list of CSS2 style attributes, see the web page at
Type: String
Type: String
Type: Object
value
attribute of the HTML <input>
tag.
If you want the button to be a graphical submit button, you can set the image property to point to an image file. This property is described above under "Appearance."
Set the event properties by right-clicking the component in the Visual Designer and choosing Edit Event Handler > eventname.
button1_action
, the IDE adds it to the page bean for you and updates the value of the Application Action property to point to that method.
If all you want to do is have the button display another page when the user clicks it, you do not need an action method. The easiest thing to do is open the page in the Navigation Editor, click the page and then click the button, and then drag to the page you want the button to open. See Setting Up Static Page Navigation for more information.
If you want the button to be able to determine which page to open based on certain conditions, then you need an action method. The action method typically processes button clicks and returns a string indicating the name of a page navigation case (the page in your application to display next). You typically define this method by right-clicking the button in the Visual Designer and choosing Edit Event Handler > action. The default name for the method is button-id
_action
, where button-id is the value of the button's id
property. For more information, see Setting Up Dynamic Page Navigation.
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
Type: String
accesskey
attribute of the HTML <input>
tag. Type: MethodBinding
Type: MethodBinding
#{Page1.action_method}
, and it must evaluate to the name of a public method that takes an ActionEvent
parameter with a return type of void. You can type a MethodBinding
expression directly into this actionListener property, for example, if you want to call a method that is not in the page bean. Type: String
dir
attribute of the HTML <input>
tag.
Values can be:
Type: boolean
The most common example of an immediate action is a Cancel button. You make it immediate so that the normal validation and update steps can be skipped, but the action handler can still do whatever is necessary. Typically, the action handler will navigate back to some previous page. In some designs the action handler might also enqueue an informational message like "Transaction cancelled". It is possible to do more: for example, an application might record the fact that the user got partially through a form and then cancelled it.
Type: String
lang
attribute of the HTML <input>
tag. To choose a language code, you can click the ellipsis button (...) to open the property editor. Some examples:
ar
- Traditional Arabicde
- Germanen
- Englishes
- Spanishfr
- Frenchja
- Japanese In addition to the codes available in the property editor, you can also enter additional codes using ISO standard names. Some examples:
en-US
- United States Englishja-JP
- Japanesezh-guoyu
- Mandarin or Standard Chinese zh-Hans
- Simplified Chinese scriptzh-HanT
- Traditional Chinese script Type: boolean
Type: String
tabindex
attribute of the HTML <input>
tag. Type: String
submit
or reset
. Equivalent to the type
attribute of the HTML <input>
tag. If the Image URL property is specified, this value is ignored because the type
has to be image
, and the button has to be an input button.