PrimeFaces DataTable具有可滚动标题

时间:2012-12-05 14:29:52

标签: jsf jsf-2 primefaces scroll

我有一个PrimeFaces dataTable,我想让它的标题可滚动。我要将图像嵌入标题中,因此当内容向下滚动时,图像应该消失。代码看起来像;

 <p:dataTable id="dataTable" liveScroll="true"
                     value="#{....}" var="...." scrollable="true"
                     scrollRows="3"
                     scrollHeight="490" rows="3">
            <f:facet name="header">
                <p:graphicImage value="/images/..."></p:graphicImage>
            </f:facet>
            <p:column ........

1 个答案:

答案 0 :(得分:0)

你可以将它放入一个scrollPanel

<p:scrollPanel>
     <p:dataTable id="dataTable" liveScroll="true"
                 value="#{....}" var="...." scrollable="true"
                 scrollRows="3"
                 scrollHeight="490" rows="3">
        <f:facet name="header">
            <p:graphicImage value="/images/..."></p:graphicImage>
        </f:facet>
        ...
</p:scrollPanel>