Reputation: 39
I'm trying to use tooltip in a p:selectOneMenu
.
I need to show different information tooltip for each option in the f:selectItem
when you do a mouse over or just "pre-select" the option.
I have the information need for it in the same list that I'm using for the OneSelectMenu, but I tried with the basic <p:tooltip>
and the <f:facet name="itemtip">
from:
and nothing works.
What you can recommend me to do? Im using PrimeFaces 6.1.
Upvotes: 2
Views: 2824
Reputation: 580
For this you can use the attribute itemDescription
.
Here is a working working example tested with PF 6.1 (Joinfaces jsf-spring-boot-starter), Firefox, Chrome, IE and even Edge:
<p:selectOneMenu>
<f:selectItems value="#{selectOneMenuTooltipView.cars}" var="car"
itemLabel="#{car.name}" itemValue="#{car}"
itemDescription="#{car.desc}" />
</p:selectOneMenu>
Upvotes: 2