0
How do I make for the dataTable
only be displayed after I click Reply Simulated? When loading the page, the dataTable
first logo is already displayed, even I have no question in it.
I have a Command Button
:
<p:column headerText="Responder Simulado" style="width: 100px; text-align: center">
<p:commandButton id="responderSimulado" icon="ui-icon-check" title="Responder Simulado" update="@this :frmCadastroSimulado:exibePerguntas"
actionListener="#{responderSimuladoBean.recuperaSimuladoDeAcordoComCicloSelecionado}">
<f:param name="ciclo" value="#{ciclo.codigo}"/>
</p:commandButton>
</p:column>
And right away, I have a datatable, which updates right after I click reply.
<p:dataTable id="exibePerguntas" var="resposta" paginator="true"
rowsPerPageTemplate="2,3,5,10,12" paginatorPosition="bottom"
value="#{responderSimuladoBean.respostas}">
<p:column headerText="Perguntas">
<br></br>
<h:outputText escape="false" value="#{resposta.questao.pergunta}" />
<p:selectOneRadio id="resposta" style="width:35%"
value="#{resposta.respostaUsuario}">
<f:selectItem itemLabel="A" itemValue="A" />
<f:selectItem itemLabel="B" itemValue="B" />
<f:selectItem itemLabel="C" itemValue="C" />
<f:selectItem itemLabel="D" itemValue="D" />
<f:selectItem itemLabel="E" itemValue="E" />
</p:selectOneRadio>
<h:outputText value="#{resposta.resultado}" />
</p:column>
</p:dataTable>