How to add a ToolTip to a SelectOneMenu?

UI Components for JSF
Post Reply
csoden
Posts: 5
Joined: 20 Feb 2020, 16:46

15 Jun 2021, 16:22

I'm trying to put a toolTip on a SelectOneMenu input, but it's not showing. I've tried the standard toolTip code:

Code: Select all

        <h:form>

            <div class="ui-fluid">
                <p:tabView>
                    <p:tab title="Items">
                        <div class="p-grid">
                            <div class="p-col-12 p-sm-3">
                                <p:outputLabel for="@next" value="Type"/>
                                <p:selectOneMenu id="types"
                                                 converter="omnifaces.SelectItemsConverter"
                                                 value="#{bean.type}">
                                    <f:selectItem noSelectionOption="true" itemValue="#{null}" itemLabel=""/>
                                    <f:selectItems value="#{bean.typeList}"
                                                   var="type"
                                                   itemLabel="#{type.typeName}"
                                                   itemValue="#{type}"/>
                                </p:selectOneMenu>
                                <p:tooltip for="types" value="Select a Type"/>
                            </div>
...

I've also tried putting the component inside a div and attaching the toolTip to the div:

Code: Select all

        <h:form>

            <div class="ui-fluid">
                <p:tabView>
                    <p:tab title="Items">
                        <div class="p-grid">
                            <div class="p-col-12 p-sm-3">
                                <p:outputLabel for="types" value="Type"/>
                                <div jsf:id="typeDiv">
                                    <p:selectOneMenu id="types"
                                                     converter="omnifaces.SelectItemsConverter"
                                                     value="#{bean.type}">
                                        <f:selectItem noSelectionOption="true" itemValue="#{null}" itemLabel=""/>
                                        <f:selectItems value="#{bean.typeList}"
                                                       var="type"
                                                       itemLabel="#{type.typeName}"
                                                       itemValue="#{type}"/>
                                    </p:selectOneMenu>
                                </div>
                                <p:tooltip for="typeDiv" value="Select a Type"/>
                            </div>
...
But no change. Any help is appreciated.
Using Primefaces 8.0.2, JBoss server 7.3.0.CD17, Omnifaces 3.6.1

Melloware
Posts: 3717
Joined: 22 Apr 2013, 15:48

16 Jun 2021, 15:24

Have you tried using title="Select a Type" to the SelectOneMenu using a normal tooltip first?
PrimeFaces Developer | PrimeFaces Extensions Developer
GitHub Profile: https://github.com/melloware
PrimeFaces Elite 13.0.0 / PF Extensions 13.0.0
PrimeReact 9.6.1

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 34 guests