Javatpoint Logo
Javatpoint Logo

PrimeFaces Chips

It is an input text box which is used to enter multiple values. The <p:chips> component is used to create input text in the JSF application. It is useful when we want to take multiple values from the user by using single component. It has various attributes that are tabled below.

Chips Attributes

Attribute Default value Type Description
rendered true Boolean It is used to specify the render component.
value null Object It is used to set value of the component.
required false Boolean It is used to mark the component as required.
validator null MethodExpr It is used to set validator for the component.
valueChangeListener null ValueChange Listener It is used to set valuechangelistener.
requiredMessage null String It is used to set message to be displayed when required field validation fails.
converterMessage null String It is used to set message to be displayed when conversion fails.
validatorMessage null String It is used to set message to be displayed when validation fields.
widgetVar null String It is used to set name of the client side widget.
max null Integer It is used to set maximum number of entries allowed.

Example

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

JSF File

// chips.xhtml

Output:

PrimeFaces Chips 1
PrimeFaces Chips 2
Next TopicPrimeFaces Button




Please Share

facebook twitter google plus pinterest

Learn Latest Tutorials


B.Tech / MCA