How to group headers of PrimeFaces dataTable with dynamic columns

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-25 11:00:08

问题


I am using slightly modified Dynamic Columns from PrimeFaces Showcase: Dynamic columns. Now my task is to add column header grouping as here PrimeFaces Showcase: Group. I am trying to start incrementaly, but even this small code doesn't work (no header are shown):

<p:dataTable id="resultTable" var="result" value="#{myBean.searchResults}">  
    <p:columnGroup type="header">
        <p:row>
            <ui:repeat value="#{myBean.columns}" var="column" >
                <p:column headerText="#{column.header}" />
            </ui:repeat>
        </p:row>
    </p:columnGroup>
    <p:columns value="#{myBean.columns}" var="column" columnIndexVar="colIndex">
        <h:outputText value="#{result[column.property]}"/>
    </p:columns>
</p:dataTable>

PrimeFaces version 3.4.1


回答1:


Grouping dynamic columns is at least supported in a newer PF version. But only all columns under the same group. But there must be additional code. Check the showcase link you point to

(Ps, will remove this answer later on, since I interpreted the question wrong



来源:https://stackoverflow.com/questions/31589079/how-to-group-headers-of-primefaces-datatable-with-dynamic-columns

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!