Good evening.
I have a page in JSF called simulate.xhtml where I implement a filter to generate the simulation and I'm also trying to display results of the database that have already been filtered on that same page , but as a result I get these results:
[com.sisEnade.tcc.modelo.Questao@20, com.sisEnade.tcc.modelo.Questao@21, com.sisEnade.tcc.modelo.Questao@22]
I tried to implement in a dataTable more whenever I click on Generate Simulate I get a notFound, it's as if the dataTable needed to reload soon after clicking the button. Can you help me with this detail too?
I'm trying to display it as follows to test:
JSF page:
<ui:define name="titulo">Gerar Simulado</ui:define>
<ui:define name="corpo">
<h1>Filtro para gerar Simulado</h1>
<h:form id="frmCadastro">
<br></br>
<h:panelGrid columns="2">
<p:outputLabel value="Curso" for="curso" style="font-weight:bold" />
<p:selectOneMenu id="curso"
value="#{gerarSimuladoBean.cursoSelecionado}"
converter="cursoConverter" required="true"
requiredMessage="Preencha o curso">
<f:selectItem itemLabel="Selecione..." />
<f:attribute name="collectionType" value="java.util.ArrayList" />
<f:selectItems value="#{cadastroQuestaoBean.cursos}" var="curso"
itemLabel="#{curso.nome}" itemValue="#{curso}" />
</p:selectOneMenu>
</h:panelGrid>
<h:panelGrid id="gridComplexidade" columns="2">
<p:outputLabel value="Complexidade da Questão" for="complexidade"
style="font-weight:bold" />
<p:selectOneMenu id="complexidade"
value="#{gerarSimuladoBean.complexidadeSelecionada}"
required="true"
requiredMessage="Por favor, preencha a complexidade.">
<f:selectItem itemLabel="Selecione..." />
<f:selectItem itemLabel="1" itemValue="1" />
<f:selectItem itemLabel="2" itemValue="2" />
<f:selectItem itemLabel="3" itemValue="3" />
<f:selectItem itemLabel="4" itemValue="4" />
<f:selectItem itemLabel="5" itemValue="5" />
</p:selectOneMenu>
</h:panelGrid>
<h:panelGrid id="gridNumeroQuestoes" columns="2">
<p:outputLabel value="Número de questoes" for="numeroDeQuestoes"
style="font-weight:bold" />
<p:selectOneMenu id="numeroDeQuestoes"
value="#{gerarSimuladoBean.numeroDeQuestoesSimulado}"
required="true"
requiredMessage="Por favor, preencha o numero de questoes.">
<f:selectItem itemLabel="Selecione..." />
<f:selectItem itemLabel="3" itemValue="3" />
<f:selectItem itemLabel="5" itemValue="5" />
<f:selectItem itemLabel="10" itemValue="10" />
<f:selectItem itemLabel="20" itemValue="20" />
<f:selectItem itemLabel="40" itemValue="40" />
</p:selectOneMenu>
</h:panelGrid>
<p:commandButton value="Gerar Simulado"
action="#{gerarSimuladoBean.gerarSimulado}" icon="ui-icon-search"
iconPos="right" update="frmCadastro">
</p:commandButton>
<br></br>
<br></br>
<br></br>
<br></br>
<p:panelGrid id="teste">
<h:outputText value="#{gerarSimuladoBean.questoes}">
</h:outputText>
</p:panelGrid>
</h:form>
</ui:define>
</ui:composition>
Excerpt where the object addresses are displayed:
<p:panelGrid id="teste">
<h:outputText value="#{gerarSimuladoBean.questoes}">
</h:outputText>
</p:panelGrid>