简体   繁体   中英

PrimeFaces dataTable multiple update

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!!!

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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM