这看起来像是PrimeFaces错误,但是您可以通过JS隐藏有关分页事件的工具提示来解决此问题。
<p:dataTable value="#{bean.val}" var="row" rowIndexVar="rowIndex" rows="10" paginator="true"> <p:ajax event="page" oncomplete="hideTooltips();" /> <p:column> <h:outputText id="text" value="#{row}" /> <!-- since p:tooltip is located inside an iterative component (p:dataTable), we can't just define a static widgetVar value, because there will be a widget instance for each iteration, and each instance must have a unique widgetVar value, so we'll use rowIndex to achieve that --> <p:tooltip widgetVar="textTipVar#{rowIndex}" for="text" value="Tip" /> </p:column></p:dataTable><script> function hideTooltips() { for (var w in PrimeFaces.widgets) { if (w.indexOf('textTipVar') === 0) { PrimeFaces.widgets[w]._hide(); } } }</script>这使用了未记录的Tooltip小部件方法
_hide,在更新到另一个PrimeFaces版本时,请记住这一点,例如,方法名称可能会更改。该
PrimeFaces.widgets对象也未记录。



