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

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

    Sergey Rogan Newbie

      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>