PanelGrid does not divide columns with Repeat

2

I have a panelgrid that I can not in any way divide into a ui: repeat columns, whatever the amount.

<h:panelGrid columns="2" >

    <ui:repeat var="p" value="#{cadSetor.campos}" >

        <p:commandLink  actionListener="#{telaLogin.chamaTelaSelecao(p.id)}" ajax="false">
            <p:graphicImage value="/imagensSetores/#{p.nomeImagem}" width="210" style="border: 0px; margin-top:1px" />
        </p:commandLink>

    </ui:repeat>

</h:panelGrid>

Can anyone help me with this?

    
asked by anonymous 29.06.2016 / 03:58

1 answer

2

ui: repeat will not work because it does not actually add components to the component tree.

ui: repeat works only during the rendering phase and re-renders its child components several times with a different state.

Some components, such as panelGrid , but also data table, expect to have some children in the component tree in order to function properly. Since ui: repeat does not add them, this approach does not work.

Try to use c:foreach because it can be a solution instead of ui: repeat .

Take a look at here on c:foreach for a better understanding of why to this question , c:foreach may be better.

    
29.06.2016 / 07:54