0
I have a button inside a <p:toolbarGroup>
where I do some operations, I also have a <p:panelGrid>
which should be rendered after the user clicks the button, but I cannot update this component. I can update the table and values of the toolbarGroup
but the rest 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 that does not even update.
The component is only updated after a F5
. Why isn’t the update working? Am I forgetting something?
tried the
process="@this"
on the button?– Rafael
Already @Rafael, it did not work and it also gives error in the processes. I’m doing a test and the condition of the Renderer is false, but it does not appear. kk
– DiegoAugusto
Look, here’s when I enter the system, down there I’m displaying the variable Boolean: http://i.stack.Imgur.com/iSfyI.png
– DiegoAugusto
After I click on the button it turns FALSE, now that the panel was supposed to appear but it does not appear: http://i.stack.Imgur.com/v9Opk.png
– DiegoAugusto
Strange that until the update of
<h:outputText>
is working– DiegoAugusto
Well, first of all, watch out for the inlines in your encoding, they are not considered good practice. ;) Make sure that the list you are picking up is getting a bean value. Maybe (depending on the scope you set in the backing bean) it is being reset or even not initialized. I hope I helped. P.S.: I did not comment on your question for lack of reputation.
– Weslley Tavares
The list is working correctly and the
inlines
are for testing.– DiegoAugusto
I know it’s kind of trivial, but have you ever tried to play a system.out on the get list that’s on the backing bean?
– Weslley Tavares
You are updating an unprocessed component. Update the parent component of your panelGrid. If you do not want to update the whole form, enclose it in a
p:panel
and then updates such a panel.– Rodrigo
Already yes, and if the list had not worked my datatable would not be filled
– DiegoAugusto
Try to isolate it in another form or in a <h:panelGroup>.
– Weslley Tavares
That’s right @Rodrigo answer the question so I can mark it as correct.
– DiegoAugusto
Already solved the problem thanks
– DiegoAugusto
@Techies Could post the solution as answer?
– bfavaretto
I’m waiting to see if @Rodrigo responds because he helped me in the comments
– DiegoAugusto