rich:suggestionbox in flight request causing issues
bjm88 May 10, 2010 2:54 PMHi,
I have a weird issue and I believe I've narrowed it down to in-flight ajax request started from rich:suggestionbox. I'm developing on Websphere 7.0.0.9, JSF RI 1.2, RichFaces 3.3.2, and Facelets 1.1.15. I have a situation where the user wants an input box that has a suggestionbox attached but may also can just add a * wildcard character during their input and hit "enter" resulting in a full form post submission (regular commandButton). If the user is not that fast, everything works fine, however if they are quick I have rendering problems. It seems if they are typing and the rich:suggestionbox is hitting the db on each key stroke after minChars=2 and they hit enter before results of last request are back, the main dataTable rendered below does now have the proper, if any, rowIndex set. I bind an HTMLDataTable element in my xhtml and generally it works fine, but if full post submitted before ajax request is back rowIndex coming as -1 or blank. This then creates an error when they click link in dataTable. Some xhtml tag snipplets below. Any idea on this? Is this a common problem with JSF and concurrent request? I would think this may be a general issue with ajax calls and JSF and probably not specific to the rich:suggestionbox. Any ideas or parameters I can use to control this or queue things up? Any response is greatly appreciated, thank you.
-Ben
<h:dataTable id="accountResultsDataTable" value="#{accountsMB.accountRowPageBeans}"
binding="#{accountsMB.accountListingDataTable}"
var="accountRow" rendered="#{accountsMB.haveResults == 'true'}" styleClass="dataTable"
headerClass="dataTableHeader" first="0" rows="#{accountsMB.accountSearch.rowsPerPage}"
rowClasses="dataTableRow, dataTableRowColor" style="float: left;">
<h:column>
<f:facet name="header">
<h:commandLink action="#{accountsMB.doSortByAccountName}" >
<h:outputText value="Account" style="text-decoration: underline;"/>
<h:outputText value="^" style="text-decoration: none;"
rendered="#{accountsMB.accountSearch.accountNameSort == true and accountsMB.accountSearch.sortOrder == 'ASC'}" />
<h:outputText value="v" styleClass="sortOrderIndicator"
rendered="#{accountsMB.accountSearch.accountNameSort == true and accountsMB.accountSearch.sortOrder == 'DESC'}" />
</h:commandLink>
</f:facet>
<h:commandLink action="#{accountsMB.doSelectAccountRow}" >
<h:outputText value="#{accountRow.accountNo} - #{accountRow.accountName}" />
<f:param name="selectedIndexRow" value="#{accountsMB.accountRowIndex}" />
</h:commandLink>
</h:column>
.....