如何在< p:column>的headerText属性中添加图像? [英] How to add image in headerText attribute of <p:column>?

查看:98
本文介绍了如何在< p:column>的headerText属性中添加图像?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在<p:column>的headerText属性中添加图像?

How to add image in headerText attribute of <p:column>?

<p:dataTable id="tableId" var="list" value="#{beanRequest.list}" >
    <p:column headerText="Date">
        <h:outputText value="#{list.date}"  />
    </p:column>
    p:column headerText="A">
        <h:outputText value="#{list.a}" />
    </p:column>
    <p:column headerText="????????image here?????????">
        <h:outputText value="#{list.b}"/>
    </p:column>
</p:dataTable>

推荐答案

使用<f:facet name="header">代替,以指定非简单文本内容.

Use <f:facet name="header"> instead to specify non-simple-text content.

<p:column>
    <f:facet name="header">
        <h:graphicImage name="weather.png" />
    </f:facet>
    ...
</p:column>

这篇关于如何在&lt; p:column&gt;的headerText属性中添加图像?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆