-
1. Re: reRender and consultations to the database
thejavafreak Sep 11, 2008 2:58 AM (in response to micayael)Because the value of the referenced object has changed. Try making it into two different objects in your Action class. One for the datatable, the other one for the select, Hopefully it works.
-
2. Re: reRender and consultations to the database
micayael Sep 11, 2008 1:43 PM (in response to micayael)Thanks for reply Joshua.
What do you mean for two different objects in the action class? There are two separated metods. And I use the datatable like this
rich:dataTable with the value binding to test.consultas and the onother one binding to test.avisos//-- @Name(test) public List<Aviso> getAvisos() { if (avisos == null) { avisos = oferenteSubasta.getDefinedInstance().getAvisos(); } } public List<Consulta> getConsultas() { if (consultas == null) { consultas = oferenteSubasta.getDefinedInstance().getConsultas(); } }
-
3. Re: reRender and consultations to the database
micayael Sep 11, 2008 4:21 PM (in response to micayael)Sorry I forgot the returns into the two metods. There is a return avisos and a return consultas at the end of the metods.
-
4. Re: reRender and consultations to the database
stefanotravelli Sep 11, 2008 7:21 PM (in response to micayael)Maybe you haven't enclosed the two table in two different a4j:region so that they are both decoded on the server for each request.
If this is the case, try looking at a4j:region and a4j:outputPanel in the RichFaces doc.
-
5. Re: reRender and consultations to the database
micayael Sep 11, 2008 8:39 PM (in response to micayael)I tried that Stefano. but is the same.
<a4j:region id="commonRegion2"> <a4j:outputPanel id="panelConsultas"> <rich:dataTable value="#{prueba.consultas}" var="o" rowClasses="rvgRowOne,rvgRowTwo" id="consultasTable" style="width: 600px;"> <rich:column> <f:facet name="header">Consultas</f:facet> #{o.id} </rich:column> <rich:column> <f:facet name="header">Titulo</f:facet> #{o.titulo} </rich:column> </rich:dataTable> </a4j:outputPanel> </a4j:region> <a4j:region id="commonRegion"> <a4j:outputPanel id="panelAvisos"> <rich:dataTable value="#{prueba.avisos}" var="o" rowClasses="rvgRowOne,rvgRowTwo" id="avisosTable" style="width: 600px;"> <rich:column> <f:facet name="header">Avisos</f:facet> #{o.id} </rich:column> <rich:column> <f:facet name="header">Titulo</f:facet> #{o.titulo} </rich:column> </rich:dataTable> </a4j:outputPanel> </a4j:region>
My Button is here
<a4j:form ajaxSubmit="true" id="form1"> <a4j:commandButton value="Actualizar Avisos" id="btnActualizarAvisos" reRender="panelAvisos"> </a4j:commandButton> </a4j:form>
LOG
14:45:04,765 INFO [Prueba] OBTENIENDO CONSULTAS... 14:45:04,765 INFO [STDOUT] Hibernate: select subasta0_.id... 14:45:04,812 INFO [STDOUT] Hibernate: select consultas0_.subasta_id... 14:45:04,812 INFO [Prueba] OBTENIENDO AVISOS... 14:45:04,859 INFO [STDOUT] Hibernate: select avisos0_.subasta_id...
-
6. Re: reRender and consultations to the database
micayael Sep 18, 2008 1:11 PM (in response to micayael)Hi. Anyone know what's wrong with this code?
-
7. Re: reRender and consultations to the database
jonh04 Oct 2, 2008 3:04 PM (in response to micayael)I'm having the exact same error. Does anybody know a solution? aka bump
Thanks in advance!