Reputation: 6989
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.
Upvotes: 0
Views: 1301
Reputation: 1108922
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" />
Upvotes: 1