Please note, this is a STATIC archive of website www.javatpoint.com from 19 Jul 2022, cach3.com does not collect or store any user information, there is no "phishing" involved.
Javatpoint Logo
Javatpoint Logo

PrimeFaces CommandButton

It is an extended version of standard h:commandButton of JSF. It includes ajax, partial processing and skinning features.

The <p:commandButton> component is used to create button in JSF application. It is useful when we want to perform action in web application.

This component has various attributes that are tabled below.

CommandButton Attributes

Attribute Default value Type Description
rendered true Boolean It is used to specify the rendering of the component.
value null String It is used to set label for the button.
action null MethodExpr/String It is used to set action when button is clicked.
actionListener null MethodExpr It is used to set actionlistener that'd be processed when button is clicked.
type submit String It sets the behavior of the button.
ajax true Boolean It specifies the submit mode.
async false Boolean When set to true, ajax requests are not queued.
process null String It is used to process partially instead of whole view.
update null String It is used for component to be updated with ajax.
global true Boolean It defines whether to trigger ajaxStatus or not.
delay null String It is used to set delay value.
partialSubmit false Boolean It enables serialization of values belonging to the partially processed components only.
timeout 0 Integer It is used to set timeout for the ajax request in milliseconds.

Example

Here, in the following example, we are implementing <p:commandButton> component. This example contains the following files.

JSF File

// commandButton.xhtml

ManagedBean

// CommandButton.java

Output:

PrimeFaces CommandButton 1
PrimeFaces CommandButton 2





Youtube For Videos Join Our Youtube Channel: Join Now

Feedback


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA