118
PrimeFaces FieldSet
It is a grouping component and an extension of html fieldset. It is a kind of container that has a legend and content. It is used to display categorized data.
PrimeFaces provides <p:fieldset> component which is used to create fieldset in JSF application. It has various attributes that are tabled below.
FieldSet Attributes
Attribute | Default value | Type | Description |
---|---|---|---|
legend | null | String | It is used to set title text. |
style | null | String | It is used to set inline CSS of the fieldset. |
toggleable | false | Boolean | It is used to make content togglable with animation. |
toggleSpeed | 500 | Integer | It is used to set toggle duration in milliseconds. |
collapsed | false | Boolean | It is used to define initial visibility state of content. |
Example
Here, in the following example, we are implementing <p:fieldset> component. This example contains the following files.
JSF File
// fieldset.xhtml
Output:
Next TopicPrimeFaces Layout