3 Replies Latest reply on Oct 3, 2013 3:20 PM by bleathem

    Using rich:autocomplete inside JSF 2 composite component

    nasir.imtiaz

      Hi,

      I am trying to use Richfaces 4 rich:autocomplete component inside a JSF 2 composite component by exposing the autocompleteMethod as follows:

       

      composite component : filter.xhtml

      ...
      <composite:interface>
        <composite:attribute name="autocompleteMethod" required="true" method-signature="java.util.List autocompleteMethod(java.lang.String)" />
      </composite:interface>
      <composite:implementation>
        <rich:autocomplete autocompleteMethod="#{cc.attrs.autocompleteMethod}" var="result" fetchValue="#{result.name}" mode="ajax" >
             #{result.name}
        </rich:autocomplete>
      </composite:implementation>
      ...
      
      

       

      client page

      ...
      <util:filter autocompleteMethod="#{geoBean.suggest}" />
      ...
      
      

       

      GeoBean.java

      public List<City> suggest(String keyword) {
        List<City> result;
      
        // Logic to return list of cities goes here...
      
        return result;
        }
      
      

       

      Now, when i put a breakpoint at the GeoBean.suggest(), i notice that the method is getting called when i type something in the input text, but the keyword received at this point does not show me the typed value. Instead it shows com.sun.faces.context.FacesContextImpl@1376b55 as the value of keyword.

       

      Kindly help me to figure out what am i missing.

       

      Thanks.

       

      Environment:
      Richfaces 4.3.3

      JSF 2.1.3