简体   繁体   中英

Primefaces CommadButton not update DataTable

I have the next structure in my xhtml

<p:panel>
    <p:acordeonPanel>
      <p:tab>
      <h:form>
      <table>
          <tr>td><commandButton action="#{myBean.searchAnimals}"update=":form:partidos" ></td></tr>
      </table>
      </h:form>
      </p:tab>
    </p:acordeonPanel>
</p:panel>
<p:panel>
<h:form id="form">
    <p:dataTable id="partidos" value="#{myBean.foundAnimals}">
</h:form>
....

The method searchAnimals() it´s OK, it returns the Animal items, but the dataTable doesn't refresh, but in the java code (managedBean) the ArrayList contains the items. What can i do? Thanks

EDIT: I have de h: and the p: suffix correctly (i think so), the code is part of the complete code but is the fragment that doesn't work correctly. In the first panel i have a filter controls (by category, by date, etc.) and the function of the command button is call a function that execute a query on the database, this function is well because it's filling the ArrayList with the resultset (myBean.foundAnimals) but these items doens't refresh on the view (dataTable) :(

您应同时使用<h:form>并将命令按钮的呈现值设置为rendered=":form" ,以在单击命令按钮后实现重新rendered=":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