ui: repeat + p: datatable question

后端 未结 2 1403
闹比i
闹比i 2020-12-22 04:49

I displaying multiple p:datatable \'s through ui:repeat, the following code snippet illustrates what I am doing:



        
相关标签:
2条回答
  • 2020-12-22 05:35

    This is likely related to JSF issue 1830.

    Your best bet is to replace ui:repeat by another repeater which does its UINamingContainer job better, for example a <p:dataList> or even another <p:dataTable>. The list bullets of <p:dataList> can be removed by CSS list-style-type: none.

    If that also doesn't work, then it's maybe a bug in PrimeFaces <p:dataTable> itself.

    0 讨论(0)
  • 2020-12-22 05:36

    The only way I found was to use two p:datatable tags, the parent one with only one column. I couldn't make it work with p:dataList. I guess p:dataList is extending the same bogus class.

    Should work with this:

    <p:datatable id="searchTables"
        value="#{searchBean.mapKeys}"
        var="mapKeys">
        <p:column>
             <p:dataTable id="recordTable"
                value="#{searchBean.resultMap[mapKeys].resultList}"
                var="recordTable"
                paginator="true"
                rows="10">
                     <f:facet name="header">
                          <h:outputText value="#{searchBean.resultMap[mapKeys].name}"/>
                     </f:facet>
                        <p:columns value="#{searchBean.resultMap[mapKeys].resultColumns}"
                                   var="column"
                                   columnIndexVar="colIndex">
                            <f:facet name="header">
                                <p:outputPanel>
                                    #{column.header}
                                </p:outputPanel>
                            </f:facet>
                            <h:outputText value="#{recordTable[column.property]}"/><br/>
                        </p:columns>
             </p:dataTable>
        </p:column>     
     </p:dataTable>
    
    0 讨论(0)
提交回复
热议问题