简体   繁体   中英

p:tooltip for items of p:pickList

I'm struggling to use a primefaces p:tooltip for items of a p:pickList .

I have a pickList defined as:

<p:pickList id="stepPickList" 
            value="#{activityBean.stepDualListModel}"
            var="step"
            showSourceFilter="true" 
            showTargetFilter="true" 
            filterMatchMode="contains"
            itemLabel="#{step}" 
            itemValue="#{step}"
            addAllLabel="#{messages.label_addAll}"
            addLabel="#{messages.label_add}"
            removeAllLabel="#{messages.label_removeAll}"
            removeLabel="#{messages.label_remove}"
            moveBottomLabel="#{messages.label_moveBottom}"
            moveDownLabel="#{messages.label_moveDown}"
            moveTopLabel="#{messages.label_moveTop}"
            moveUpLabel="#{messages.label_moveUp}"
            showTargetControls="true">

    <o:converter converterId="omnifaces.ListConverter" list="#{activityBean.stepSource}"/>

    <f:facet name="sourceCaption"> #{messages.step_list}</f:facet>  
    <f:facet name="targetCaption"> #{messages.label_stepList}</f:facet>

    <p:column style="width:100%;">  
        <h:outputText id="nameID" value="#{step.name}" /> 
        <p:tooltip for="nameID" value="#{step.description}" />
    </p:column>
</p:pickList>

This seems to show all tooltips for each item when mouse over the first element only... I tried with primefaces extension's tooltip pe:tooltip and I get weird behavior too...

So, first of all, can a tooltip be used on h:outputText? If not, what kind of component should I use? (I tried with h:outputLink as seen in many examples on primefaces and pe showcases and still not the desired effect)

thanks for any hints !!

It's difficult to replicate your error without the backing bean code, but have you tried

<p:column>  
    <h:outputText value="#{step.name}" title="#{step.description}" /> 
</p:column>

?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM