ExtendedDataTable filtering problem
nimoh Jan 26, 2011 1:23 PMHello,
I am trying to filter a column in an extendeddata table using a selectOneMenu and I am having trouble with the event ordering. When the onchange even fires, it reRenders my table, and after that, the bean is updated for the selectOneMenu
<rich:extendedDataTable width="100%" height="99%" id="SubjectTable"
value="#{participationStatusHandler.dataModel}" var="subjectRow"
rows="2" sortMode="#{participationStatusHandler.sortMode}"
selectionMode="#{participationStatusHandler.selectionMode}"
selection="#{participationStatusHandler.selection}"
tableState="#{participationStatusHandler.tableState}"
noDataLabel="No subjects could be found"
renderIfSinglePage="true" headerClass="subjectTableHeader">
...
<rich:column sortable="true" sortBy="#{subjectRow.status}" id="col6"
filterMethod="#{participationStatusHandler.filterStatus}"
width="10%" label="Current Status">
<f:facet name="header">
<h:outputText value="Current Status" id="CurrentStatus"/>
</f:facet>
<f:facet name="filter">
<h:selectOneMenu value="#{participationStatusHandler.currentStatusFilterValue}"
id="statusFilterInput">
<f:selectItems value="#{participationStatusHandler.statusItems}"/>
<a4j:support event="onchange" reRender="statusFilterInput, SubjectTable, topScroller"
ignoreDupResponses="true" requestDelay="300"/>
</h:selectOneMenu>
</f:facet>
<h:outputText value="#{subjectRow.status}"/>
</rich:column>
In my backing bean, I am doing a system.out in the setCurrentStatusFilterValue and in the filterStatus method, and get the following in my console when changing the selction in the selectOneMenu from withdrawn to active:
comparing withdrawn to withdrawn (current)
comparing active to withdrawn (current)
comparing active to withdrawn (current)
comparing inactive to withdrawn (current)
comparing withdrawn to withdrawn (current)
comparing active to withdrawn (current)
*********************set current status filter value to active
So, the console messages show the filterStatus is using the value of currentStatusFilterValue prior to the change (it is using withdrawn). Then shortly after the filterStatus method complete, the currentStatusFilterValue is updated (to active). The end result is that my filter is always one step behind.
Anyone have a solution to this? Also, I would be more than happy to post more code if needed.