2015-09-28 41 views
1

所以我有一個搜索框,長標籤內,例如:XHTML文本字段裏面藏着

「姓名,姓氏,PersonCode,等等......」

而文本字段太小而不適合所有。

當我將鼠標移到它上面時,我需要使整個標籤可見。

我使用文本字段的代碼是:

<p:outputPanel id="keywords_filter" rendered="#{!externalRegistryQueryController.filter.detailedFilter}"> 
    <p:inputText value="#{externalRegistryQueryController.filter.keywords}" placeholder="#{msg.extreg_keywords_placeholder}"/> 
</p:outputPanel> 
+0

除了'title'屬性,PrimeFaces還有自己的組件[''](http://www.primefaces.org/showcase/ui/overlay/tooltip/tooltipOptions.xhtml)。 – Tiny

回答

2

使用title屬性:

<p:inputText 
     value="#{externalRegistryQueryController.filter.keywords}" 
     placeholder="#{msg.extreg_keywords_placeholder}" 
     title="#{msg.extreg_keywords_placeholder}"/> 

title屬性上PrimeFaces inputText元素定義,並映射到HTML title屬性,它提供了您請求的工具提示行爲。

+1

大聲笑..現在我很慚愧,我需要在這裏發帖回答這麼簡單.. 這是作品,謝謝。 ! – iJava