2013-12-11 16 views
0

我正在努力爲p:pickList的項目使用primefaces p:tooltipp:工具提示p:pickList

我有一個選擇列表定義爲:

<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> 

這似乎顯示了每個項目的所有提示,當鼠標放在第一要素只有... 我primefaces擴展的工具提示pe:tooltip試過,我變得怪異行爲太...

因此,首先,可以在h:outputText上使用工具提示嗎? 如果不是,我應該使用什麼樣的組件? (我嘗試了h:outputLink,如在primefaces和pe展櫃上的許多例子中所看到的,仍然沒有達到預期的效果)

感謝您的任何提示!

回答

1

這是很難複製你的錯誤,而不支持bean的代碼,但你嘗試過

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

+0

當鼠標懸停在文本上時,它具有預期的行爲,但標題不會轉義html格式的字符串。 'step.description'來自'p:editor'。這就是爲什麼我想使用工具提示! –