2

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.

What I want: What i want

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:

Itemtip

and nothing works.

What you can recommend me to do? Im using PrimeFaces 6.1.

Cindy Meister
  • 25,071
  • 21
  • 34
  • 43

1 Answers1

2

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>

p:selectOneMenu tooltip

thunderhook
  • 497
  • 5
  • 21
  • @MauricioMoralesOsorio: https://stackoverflow.com/questions/11780397/primefaces-tooltip-for-pselectmanycheckbox – Kukeltje Jan 20 '18 at 09:15
  • @MauricioMoralesOsorio please provide your code then, i reproduced this example before answering your question. I've now added a working example. And why did I get a downvote? – thunderhook Jan 21 '18 at 20:11