Good afternoon.
I have a simple problem. However, I have difficulty solving it.
I have these 2 methods to control my Rendered from dataTable
:
// Filtra o simulado..
@Transactional
public void gerarSimulado() {
this.questoes = simuladoFiltroDAO.geraSimuladoPorFiltro(
cursoSelecionado.getCodigo(), this.complexidadeSelecionada,
this.numeroDeQuestoesSimulado);
isMostraQuestoesGeradasSimulado();
this.simulado.setNumeroQuestoesSimulado(numeroDeQuestoesSimulado);
this.simulado.setCurso(cursoSelecionado);
this.simulado.setQuestoes(questoes);
}
In particular this boolean
method, which controls the rendered:
public boolean isMostraQuestoesGeradasSimulado() {
return this.questoes != null;
}
On my xhtml page, I have:
<p:dataTable id="exibePerguntas" rendered="#{gerarSimuladoBean.mostraQuestoesGeradasSimulado}" var="questao" paginator="true"
rowsPerPageTemplate="2,3,5,10,12" paginatorPosition="bottom" value="#{gerarSimuladoBean.questoes}">
<p:column headerText="Perguntas">
<br></br>
<h:outputText escape="false" value="#{questao.pergunta}" />
</p:column>
</p:dataTable>
Simulate generate button code:
<p:commandButton id="geraSimulado" value="Gerar Simulado" action="#{gerarSimuladoBean.gerarSimulado}"
icon="ui-icon-search" update="@this exibePerguntas">
</p:commandButton>
By the logic, when clicking on the button "generate simulated", is already to appear the questions right? Since the questions will be populated and the result will give true
. But that's not what's happening. Does anyone know why?