PrimeFaces Tooltip

It is a small pop-up box that displays information on the event. It is used to display message to the user when the user interact with the component. It includes various features like cutom effects, events and theme support.

PrimeFaces provides <p:tooltip> component to create informative message in the JSF application.

It also has various attributes that are tabled below.

AttributeDefault valueTypeDescription
ValuenullObjectIt is used to set value of the component.
showEventmouseoverStringIt is used to set event to display tooltip.
showEffectfadeStringEffect to be used for displaying.
hideEventmouseoutStringIt is used to set event for hiding the tooltip.
hideEffectfadeStringIt is used to set effect to be used for hiding.
showDelay150IntegerIt is used to set delay time to show tooltip in milliseconds.
hideDelay0IntegerIt is used to set delay time to hide tooltip in milliseconds.
fornullStringIt is used to attach the tooltip.
stylenullStringIt is used to set inline CSS style of the tooltip.
escapetrueBooleanIt defines whether html would be escaped or not.
trackMousefalseBooleanTooltip position follows pointer on mousemove.
beforeShownullStringIt is used to execute script before tooltip is shown.
positionrightStringIt is used to set position of the tooltip.

Example

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

JSF File

// tooltip.xhtml

Output:

PrimeFaces Tooltip 1