0
Good afternoon.
I have a simple problem. However, I am struggling to solve.
I have these 2 methods to control my Rendered do 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 that method boolean
, that 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>
Simulated generate button code:
<p:commandButton id="geraSimulado" value="Gerar Simulado" action="#{gerarSimuladoBean.gerarSimulado}"
icon="ui-icon-search" update="@this exibePerguntas">
</p:commandButton>
By logic, when clicking on the button "generate simulated", it is already to appear the questions right? Since the questions will be populated and the result will give true
. Only that’s not what’s happening. Does anyone know why?
put the button code there. Please.
– RafaelTSCS
@Rafaeltscs the code of the simulated Generate button is the public void method gerarSimulado(). The method is above!
– Felipe Portela
phallus of JSF (HTML)
– RafaelTSCS
All right, I’ll put.
– Felipe Portela
@Rafaeltscs ta aí mano.
– Felipe Portela