Update does not work when trying to update a p: panelGrid

0

I have a button that is within <p:toolbarGroup> where I perform some operations, I also have a <p:panelGrid> that should be rendered after the user clicks the button, but I can not update this component. I can update the table and values of toolbarGroup but the rest do not.

Button code:

<p:commandButton value="Gerar Relatórios" style="margin-left:10px"
        actionListener="#{relatorioBean.gerarRelatorio()}"
        rendered="#{relatorioBean.listaVazia == true}" id="btnGerar"
        update=":msgGlobal :frmPrin:arquivoTable :frmPrin:pnlCadastro" />

PanelGrild:

<p:panelGrid columns="2" id="pnlCadastro"
        style="width:100%;margin-top:20px" columnClasses="rotulo, campo"
        rendered="#{relatorioBean.listaVazia == false}">

As you can see this panel is only rendered when the condition is false, but when I click the button the condition changes to false, only the panel does not update itself.

The component is only updated after a F5 . Why is not the update working? Am I forgetting something?

    
asked by anonymous 20.10.2015 / 18:34

1 answer

0

The problem is that you are trying to update a component - using update - which is not yet rendered. Even if in the current action it changes the condition from rendered to true.

To resolve this, update must be done in the parent component of the one that has not yet been rendered. I would like to include it in <p:panel> and enter its id in update of its commandButton .

    
21.10.2015 / 20:54