如何制作工具提示以使用 Primefaces 5.x 显示静态页面片段?

How to make a tooltip to show a static page fragment using Primefaces 5.x?

在我的网络应用程序中,我必须显示丰富的工具提示,这意味着,带有一些文本的工具提示有时格式丰富,甚至带有图像或表格。

我计划将工具提示的内容放在 .xhtml 文件中,这样在需要时重新格式化它们会更容易。

但是,我找不到任何显示此行为的示例或代码示例。我想我必须组合某些组件才能达到我想要的效果,但无法弄清楚。

这可能吗?怎么样?

拜托,下次你在提问之前必须阅读 Primefaces 文档。非常简单。

<html xmlns="http://www.w3.org/1999/xhtml"
    xmlns:h="http://java.sun.com/jsf/html"
    xmlns:f="http://java.sun.com/jsf/core"
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets"
    xmlns:p="http://primefaces.org/ui">
<h:head>
</h:head>
<h:body>
    <h:form id="mainForm">
        <h:outputText value="I must to look at Primefaces Showcase: " />
        <h:outputLink id="content" value="#">
            <h:outputText value="Primefaces" />
        </h:outputLink>
        <p:tooltip id="toolTipContent" for="content">
            <ui:include src="include.xhtml" />
        </p:tooltip>
    </h:form>
</h:body>
</html>

include.xhtml

<ui:composition 
    xmlns="http://www.w3.org/1999/xhtml"
    xmlns:f="http://xmlns.jcp.org/jsf/core"
    xmlns:h="http://xmlns.jcp.org/jsf/html"
    xmlns:ui="http://xmlns.jcp.org/jsf/facelets">
    <h2>Include tooltip</h2>
    <h:graphicImage value="http://www.primefaces.org/showcase/javax.faces.resource/main/images/logoBlue.svg.xhtml" />
</ui:composition>