4 Replies Latest reply on Oct 17, 2014 6:44 AM by liumin hu

    Issue with <rich:autocomplete>

    Daniel Dausch Newbie

      I am using RichFaces 4.3.6 and jsf 2.2. The issue is pretty basic - i can not get the autocomplete widget to function properly. I have a rich:popupPanel with my autocomplete embedded in that as follows:

      <rich:popupPanel id="inputCorpId" width="360" height="140"  style="z-index:123" domElementAttachment="parent" top="true">

        <f:facet name="header">Select Employee</f:facet>

        <h:panelGrid columns="6" border="0">

       

        <h:outputLabel value="Corp Id:"></h:outputLabel>

         

        <rich:autocomplete mode="cachedAjax"  style="vertical-align:top;" id="employeeAutoComplete"

             minChars="4" autocompleteMethod="#{tripMaintBean.searchForEmployees}"

             var="employee" fetchValue="#{employee}"

             value="#{tripMaintBean.employeeSearch}"

             selectFirst="false"  showButton="true">

        </rich:autocomplete>

      </h:panelGrid>

      </rich:popupPanel>

       

      The tripMaintBean has the searchForEmployees method as follows:

       

      public List<String> searchForEmployees(String searchBy){

       

        this.searchEmployee = new ArrayList<String>();

       

        this.searchEmployee.add("Person 1");

        this.searchEmployee.add("Person 2");

       

        return this.searchEmployee;

        }

       

      I verified that the autocompleteMethod is called once the 4rth character is entered during RENDER_RESPONSE phase. The List of Strings is properly populated and the

      array looks fine. No errors are generated. Once it returns from server, the drop down is still empty. Not sure what to do at this point. I dummied down the implementation

      to eliminate complexity but still no luck. Any thoughts or suggestions? Is the rich:autocomplete not being rerendered? Do i need to force that some how?

      Thanks in advance.