Dynamic columns with List in

后端 未结 1 1968
情话喂你
情话喂你 2021-01-14 09:52

I\'m attempting to generate a dataTable with columns dinamycally, so I\'ve a List when a List inside of a List

相关标签:
1条回答
  • 2021-01-14 10:16

    The <p:columns value> cannot refer the <p:dataTable var>. It is technically and logically not possible to control the columns on a per-row basis. They have to be controlled on a per-table basis.

    If your model guarantees that every nested list has the same size, then this should do:

    <p:dataTable value="#{controlador.estadistico}" var="lista">
        <p:columns value="#{controlador.estadistico[0]}" columnIndexVar="i">
            #{lista[i]}
        </p:columns>
    </p:dataTable>
    

    See also the <p:columns> showcase.

    0 讨论(0)
提交回复
热议问题