5 Replies Latest reply on Sep 13, 2011 3:29 AM by liuliu

    How to use <a4j:queue> for  <rich:autocomplete>?

    crusader0x0

      Hi!

       

      I am in RF4 + JFS 2 development and try use <a4j:queue> for <rich:autocomplete>, but it not work :-(.

       

      I insert <a4j:queue requestDelay="5000"/> inside <h:form> and when i type text in <rich:autocomplete>  ajax (in autocomplete component) send request immediately, e.g. without the delay specified in attribute requestDelay in <a4j:queue>. May anybody help me to done my task?

       

      It is my code:

       

      <composite:implementation> 
          <rich:panel id="panel" header="#{cc.attrs.panelHeaderCaption}" style="width: 600px; align=center">
              <h:form>
                  <a4j:queue requestDelay="5000"/>
                  <h:panelGrid id="panelGrid" columns="2" cellpadding="5">
                      <h:outputText value="Region: " style="font-weight: bold;"/>
                      <rich:autocomplete id="REGION_SELECTOR"
                                         showButton="true"
                                         var="regionTerritory"
                                         value="#{addressSelectBean.regionSelectedTerritory}"
                                         fetchValue="#{regionTerritory.territoryName}, #{regionTerritory.reduction.name}"
                                         autocompleteMethod="#{addressSelectBean.regionAutocompleteMethod}"
                                         mode="ajax" minChars="1"
                                         autofill="false"
                                         converter="ru.rao.oriscat.face.view.AddressSelectConverter"
                              >
                          <a4j:ajax event="selectitem" render="selectedRegion"/>
                          #{regionTerritory.territoryName}, #{regionTerritory.reduction.name}
                      </rich:autocomplete>
      
                      <h:outputText value="Selected region: "/>
                      <h:outputText id="selectedRegion"
                                    value="#{addressSelectBean.regionSelectedTerritory.territoryName}, #{addressSelectBean.regionSelectedTerritory.reduction.name}"/>
      
                  </h:panelGrid>
              </h:form>
          </rich:panel>
      </composite:implementation>
      
        • 1. Re: How to use <a4j:queue> for  <rich:autocomplete>?
          crusader0x0

          I am still alone in the dark

          • 2. Re: How to use <a4j:queue> for  <rich:autocomplete>?
            crusader0x0

            Hey, people, i need help from masters! ;-)

            • 3. Re: How to use <a4j:queue> for  <rich:autocomplete>?
              iabughosh

              Sergey,

              try this :

              <a4j:queue name="myQ" requestDelay="5000"/>

              <rich:autocomplete id="REGION_SELECTOR"
                                                 showButton="true"
                                                 var="regionTerritory"
                                                 value="#{addressSelectBean.regionSelectedTerritory}"
                                                 fetchValue="#{regionTerritory.territoryName}, #{regionTerritory.reduction.name}"
                                                 autocompleteMethod="#{addressSelectBean.regionAutocompleteMethod}"
                                                 mode="ajax" minChars="1"
                                                 autofill="false"
                                                 converter="ru.rao.oriscat.face.view.AddressSelectConverter"
                                      >
                                  <a4j:ajax event="selectitem" render="selectedRegion"/>
                                  #{regionTerritory.territoryName}, #{regionTerritory.reduction.name}

                                  <a4j:attachQueue name="myQ"/>
                              </rich:autocomplete>

              • 4. Re: How to use <a4j:queue> for  <rich:autocomplete>?
                okanxyz

                it seems that we have a same problem....

                 

                Is there solution for this problem????

                 

                I try suggestion from above, but there is no solution. I still having request burst to my server.

                • 5. Re: How to use <a4j:queue> for  <rich:autocomplete>?
                  liuliu

                  why not try requestDelay attribute of suggestion box?