Browsers provide native support for showing tooltips using the
title attribute, but it is too primitive. PrimeFaces provides a Tooltip component with enhanced features and various customization options such as effects, events and custom content support.
By default, tooltips will be displayed on the
mouseover event and hides on the
mouseout event. We can customize this behavior using the
<p:tooltip for="emailId" showEvent="focus" hideEvent="blur" value="Please enter Email Id (Ex: email@example.com)"/>
We can also specify tooltip text using the
title attribute on the component itself:
<p:inputText id="emailId" value="" title="Please enter Email Id (Ex: firstname.lastname@example.org)" ...