Panelgrid does not share columns with Repeat

Asked

Viewed 150 times

2

I have a panelgrid that I can not in any way divide in columns a ui:repeat, 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 someone help me with that?

  • I couldn’t understand your doubt.

1 answer

2


ui: repeat won’t work because it doesn’t actually add components to the component tree.

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

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

Try to use c:foreach because it may be a solution in place of the ui: repeat.

Take a look here about c:foreach for better understanding of why for this issue,c:foreach might be better.

  • Novatec, I had a problem after using c:foreach, sometimes simply, objects are not created on the screen, when I press F5, ai it works, it’s like c:foreach couldn’t read my list: <c:foreach var="p" items="#{cadSetor.listersSetores}""> If you know what it can be, thank you.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.