0

I have a JSF search command button and a tomahawk dataTable that showing the result from a search. When clicking on the command button, the dataTable should output the search result. Anyway, since I use the JSF Ajax, the dataTable doesn't show. I am just wondering whether JSF Ajax cause the problem?

Here is the problematic code that cause the table now render:

<h:commandButton id="search" value="#{msg.Label_Search}" action="#{theBean.doSearch}">
  <f:ajax render="searchStatus" execute="@form" />
</h:commandButton>
<h:outputText id="searchStatus" value="Loading data now..." rendered="#{theBean.searchingNow}" />

<h:panelGroup id="searchResultTable">
  <t:dataTable ... />
</h:panelGroup>

*Take note on this. If the ajax code were removed. It is working fine.

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
huahsin68
  • 6,819
  • 20
  • 79
  • 113

1 Answers1

1

You're only updating the searchStatus, not the searchResultTable when the ajax request completes. So the enduser will indeed never see a visual change in the HTML representation of the searchResultTable.

Fix the <f:ajax render> accordingly so that the searchResultTable is also really updated:

<f:ajax render="searchStatus searchResultTable" execute="@form" />
BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555