1 Reply Latest reply on Dec 29, 2010 5:25 AM by nbelaevski

    Suggestion box. If user types something when query goes - it is missed.

    boraldo1

      I have a the following queue:

       

      <a4j:queue name="org.richfaces.queue.global"
                     disabled="false"
                     size="1"
                     sizeExceededBehavior="dropNew"
                     ignoreDupResponses="false"
                     onrequestqueue="disableAllSubmitButtons();"
                     onrequestdequeue="enableAllSubmitButtons();fillDimHint()"/>
      

       

      and the following suggestionbox:

       

      <rich:suggestionbox for="#{id}"
                                  var="data"
                                  id="#{suggestionBox}"
                                  suggestionAction="#{dimFinderController.searchItems}"
                                  requestDelay="200"
                                  ajaxSingle="true"
                                  ignoreDupResponses="true"
                                  usingSuggestObjects="true"
                                  nothingLabel="#{coreLabels.noSearchItem}"
                                  onselect="#{rich:element(hiddenField)}.value=#{rich:element(suggestionBox)}.component.getSelectedItems()[0].value;
                                        #{rich:element(valueField)}.innerHTML=#{rich:element(suggestionBox)}.component.getSelectedItems()[0].label;
                                        #{onselect};"
                                  oncomplete="#{rich:element(hiddenField)}.value='';#{rich:element(valueField)}.innerHTML=''">
      

       

       

      Suppose we have the following situation.

      1. User types 'a'.

      2. Query is handled by server for a long time.

      3. When response is being handled user types else one 'b'.

       

      The result: user typed 'ab' but suggestion entries are for query 'a'.

      Is it a bug of this component or can I somehow fix it?

       

      My queue size is 1 and sizeExceededBehavior="dropNew" because I don't want to load a server.

      I want to prohibit to send new query when one already goes.