104
PrimeFaces ProgressBar
It is a process status indicator that can either work purely on client side or interact with server side using Ajax. It is used to show the status and progress of executing process. ProgressBar has two modes: client and Ajax. By default, client mode is enabled. Ajax mode can be enabled by setting ajax attribute to true.
The <p:progressBar> is used to create progressbar in JSF application. It has various attributes that are tabled below.
ProgressBar Attributes
Attribute | Default value | Type | Description |
---|---|---|---|
id | null | String | It is an unique identifier of the component. |
rendered | true | Boolean | It is used to specify the rendering of the component. |
widgetVar | null | String | It is a name of the client side widget. |
value | 0 | Integer | It is used to set value of the progress bar. |
disabled | false | Boolean | It is used to disable or enable the progressbar. |
ajax | false | Boolean | It specifies the mode of progressBar. |
interval | 3000 | Integer | It is used to set interval in seconds to do periodic requests in ajax mode. |
style | null | String | It is used to set inline style of the main container element. |
styleClass | null | String | It is used to set style class of the main container element. |
labelTemplate | {value} | String | It is used to set template of the progress label. |
displayOnly | false | Boolean | It enables static display mode. |
global | true | Boolean | Global ajax requests are listened by ajaxStatus component. |
Example
Here, in the following example, we are implementing <p:progressBar> component. This example contains the following files.
JSF File
// progressBar.xhtml
ManagedBean
// ProgressBar.java
Output:
Next Topic#