3 Replies Latest reply on Feb 5, 2008 4:16 AM by ilya_shaikovsky

    Implementing suggestion box in my jsf application

      Iam trying to implement the rich faces suggestion box in my jsf application .
      The rich faces suggestion box tag is define in my jsp as shown below. the suggestion box is being implemented for the h:inputText box shown below.

      <h:form id="searchForm">
      <h:inputText value="#{oneLineSearchBean.searchText}" styleClass="textEntry" tabindex="1" size="60" maxlength="800" id="inputText" />
      <rich:suggestionbox id ="suggestionBoxId" for="inputText" suggestionAction ="#{oneLineSearchBean.buildAutoComplete}" var="result" fetchValue="#{result.query}" first="0" minChars="1" width="300" height="200">
      <h:column>
      <h:outputText value="#{result.query}"/>
      </h:column>
      </rich:suggestionbox>
      The OneLineSearchBean is defined in the session scope and the
      buildAutoComplete method in the bean is as below :

      public List buildAutoComplete()
      {
      List searchQueryList = new ArrayList();
      SearchQueryObject obj1 = new SearchQueryObject();
      obj1.setQueryName("statequery");
      obj1.setQuery("state:i*");
      SearchQueryObject obj2 = new SearchQueryObject();
      obj2.setQuery("hit:1");
      obj2.setQueryName("hit");
      searchQueryList.add(obj1);
      searchQueryList.add(obj2);
      return searchQueryList;
      }

      When I try to invoke the rich:suggestionbox I get the following error:
      [2/1/08 10:14:48:112 EST] 00000029 WebApp E [Servlet Error]-[Faces Servlet]: javax.faces.el.MethodNotFoundException: buildAutoComplete: com.equifax.ic.tdp.ui.beans.OneLineSearchBean.buildAutoComplete(java.lang.Object)
      at com.sun.faces.el.MethodBindingImpl.method(MethodBindingImpl.java:207)
      at com.sun.faces.el.MethodBindingImpl.invoke(MethodBindingImpl.java:125)
      at org.richfaces.component.UISuggestionBox.broadcast(UISuggestionBox.java:144)
      at javax.faces.component.UIData.broadcast(UIData.java:657)
      at org.richfaces.component.UISuggestionBox.broadcast(UISuggestionBox.java:137)
      at org.ajax4jsf.framework.ajax.AjaxViewRoot.processEvents(AjaxViewRoot.java:180)
      at org.ajax4jsf.framework.ajax.AjaxViewRoot.broadcastEvents(AjaxViewRoot.java:158)
      at org.ajax4jsf.framework.ajax.AjaxViewRoot.processApplication(AjaxViewRoot.java:329)
      at com.sun.faces.lifecycle.InvokeApplicationPhase.execute(InvokeApplicationPhase.java:77)
      at com.sun.faces.lifecycle.LifecycleImpl.phase(LifecycleImpl.java:220)
      at com.sun.faces.lifecycle.LifecycleImpl.execute(LifecycleImpl.java:91)
      at javax.faces.webapp.FacesServlet.service(FacesServlet.java:197)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:989)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.service(ServletWrapper.java:930)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:145)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseXMLFilter.doXmlFilter(BaseXMLFilter.java:96)
      at org.ajax4jsf.framework.ajax.xmlfilter.BaseFilter.doFilter(BaseFilter.java:220)
      at com.ibm.ws.webcontainer.filter.FilterInstanceWrapper.doFilter(FilterInstanceWrapper.java:190)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain.doFilter(WebAppFilterChain.java:130)
      at com.ibm.ws.webcontainer.filter.WebAppFilterChain._doFilter(WebAppFilterChain.java:87)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:761)
      at com.ibm.ws.webcontainer.filter.WebAppFilterManager.doFilter(WebAppFilterManager.java:673)
      at com.ibm.ws.webcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:498)
      at com.ibm.ws.wswebcontainer.servlet.ServletWrapper.handleRequest(ServletWrapper.java:464)
      at com.ibm.ws.webcontainer.servlet.CacheServletWrapper.handleRequest(CacheServletWrapper.java:90)
      at com.ibm.ws.webcontainer.WebContainer.handleRequest(WebContainer.java:744)
      at com.ibm.ws.wswebcontainer.WebContainer.handleRequest(WebContainer.java:1455)
      at com.ibm.ws.webcontainer.channel.WCChannelLink.ready(WCChannelLink.java:113)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleDiscrimination(HttpInboundLink.java:454)
      at com.ibm.ws.http.channel.inbound.impl.HttpInboundLink.handleNewInformation(HttpInboundLink.java:383)
      at com.ibm.ws.http.channel.inbound.impl.HttpICLReadCallback.complete(HttpICLReadCallback.java:102)
      at com.ibm.ws.tcp.channel.impl.AioReadCompletionListener.futureCompleted(AioReadCompletionListener.java:165)
      at com.ibm.io.async.AbstractAsyncFuture.invokeCallback(AbstractAsyncFuture.java:217)
      at com.ibm.io.async.AsyncChannelFuture.fireCompletionActions(AsyncChannelFuture.java:161)
      at com.ibm.io.async.AsyncFuture.completed(AsyncFuture.java:136)
      at com.ibm.io.async.ResultHandler.complete(ResultHandler.java:195)
      at com.ibm.io.async.ResultHandler.runEventProcessingLoop(ResultHandler.java:743)
      at com.ibm.io.async.ResultHandler$2.run(ResultHandler.java:873)
      at com.ibm.ws.util.ThreadPool$Worker.run(ThreadPool.java:1469)

      What is it that Iam doing wrong ? Any help will be appreciated .

      Is there some code examplefor implementing the rich:suggestionbox componenet.

      Thanks in advance!!!