0
votes

I'm trying to update two form components via ajax without success. Here's the code (inside a first p:dataTable):

<p:ajax event="rowSelect" 
        listener="#{gestionCierres.selectionPeriodo}" 
        update=":cierreTemplateForm:tablaZonaEmpresarial :cierreTemplateForm:labelInfoPeriodo :cierreTemplateForm:tablaZonaInfo" />

The method selectionPeriodo in Controller is related with the updating of the second dataTabla (tablaZonaEmpresarial). The element tablaZonaInfo (third p:dataTable) is not being updated. I even tried to add a specific updating method for the dataTable tablaZonaInfo in the Controller method selectionPeriodo.

Please, can anybody see the solution?

Thanks in advance!!!

1
The above referenced code:<p:ajax event="rowSelect" listener="#{gestionCierres.selectionPeriodo}" update=":cierreTemplateForm:tablaZonaEmpresarial :cierreTemplateForm:labelInfoPeriodo :cierreTemplateForm:tablaZonaInfo" /> - Kolumcil
Have you pressed F12 in your browser and watch the network traffic on that Ajax Update. See if "tableZoneInfo" is in the Ajax response. I have a feeling the XHTML is being updated its just the data in the table is not being updated so it looks like nothing is happening. - Melloware

1 Answers

0
votes

In update section you need to refer to an identifier and you need remoteCommand composant

<h:form id="form">
     <p:remoteCommand name="onRowSelected" update="id"/>

        <p:dataTable id="id"> 
        <p:ajax event="yourEvent" listener="#{function}" oncomplete="onRowSelected()"/>
          ...
        </p:dataTable>
</h:form>