How do I dataTable
only be displayed after I click on Simulate Reply? When I load the page, dataTable
logo first is already displayed, I do not even have any questions on 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 on 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>