p:dataTable is not refreshing on external ajax event

UI Components for JSF
Post Reply
User avatar
wikisky
Posts: 53
Joined: 16 Jul 2010, 17:30
Location: Oakville,ON
Contact:

18 Jul 2010, 18:54

Hi,

How to refresh Data in dataTable on external ajax event.
I want th reload data in a dataTable on ajax event and following code doesn't work.
Please suggest how to fix it.
Thanks.

Code: Select all

<h:form>
  <h:selectOneMenu id="recordsLimit" value="#{merchantTransactions.maxRecords}">
     <f:selectItem itemValue="100"/>
     <f:selectItem itemValue="1000" itemLabel="1,000"/>
     <f:selectItem itemValue="10000" itemLabel="10,000" />
     <p:ajax update="transTable" event="change" actionListener="#{merchantTransactions.resetTransactionsList}" />
  </h:selectOneMenu>
</h:form>

<h:form id="transactionsForm">
  <p:dataTable id="transTable" var="transaction" value="#{merchantTransactions.merchantTransactions}"
              dynamic="false" paginator="true" rows="20"
              paginatorTemplate="{FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"
              rowsPerPageTemplate="10,20,50,100"
              selection="#{merchantTransactions.selectedTransaction}"
              selectionMode="single" update="transactionDetailPanel"
              onselectComplete="transactionDialog.show();dp.SyntaxHighlighter.HighlightAll('code')">
...

User avatar
wikisky
Posts: 53
Joined: 16 Jul 2010, 17:30
Location: Oakville,ON
Contact:

18 Jul 2010, 19:08

Found the problem. I had to add prependId="false" in h:form

Code: Select all

<h:form prependId="false" id="transactionsForm">
<p:dataTable id="transTable" ...

Another question: Is it possible to make dataTable start loading after the page rendered?

cagatay.civici
Prime
Posts: 18616
Joined: 05 Jan 2009, 00:21
Location: Cybertron
Contact:

18 Jul 2010, 19:11

You can also use update="transactionsForm:transTable"

Post Reply

Return to “PrimeFaces”

  • Information
  • Who is online

    Users browsing this forum: No registered users and 41 guests