124
PrimeFaces Button
It is an extension to the standard h:button JSF component with advanced skinning features. It is used to send GET request on the web. The <p:button> component is used to create button in JSF application. It has following attributes.
Button Attributes
Attribute | Default value | Type | Description |
---|---|---|---|
rendered | true | Boolean | It takes boolean value to specify the rendering of the component. |
Value | null | Object | It is used to set value of the component. |
outcome | null | String | It is used to resolve a navigation case. |
includeViewParams | false | Boolean | Whether to include page parameters in target URI or not |
fragment | null | String | Identifier of the target page which should be scrolled to. |
disabled | false | Boolean | It disables button. |
accesskey | null | String | It specifies access key that when pressed transfers focus to button. |
dir | null | String | It provides direction indication for text that does not inherit directionality. |
image | null | String | It is a style class for the button icon. |
lang | null | String | It is used to specify language. |
tabindex | null | Integer | It is used to set position in the tabbing order. |
title | null | String | It provides advisory tooltip information. |
href | null | String | It is used to link resource directly to implement anchor behavior. |
icon | null | String | Icon of the button. |
iconPos | left | String | It provides position of the button icon. |
target | _self | String | The window target. |
escape | true | Boolean | It defines whether label would be escaped or not. |
disableClientWindow | false | Boolean | Disable appending the ClientWindow. |
Example
Here, in the following example, we are implementing <p:button> component. This example contains the following files.
JSF File
// button.xhtml
Output:
Next TopicPrimeFaces CommandButton