2 Replies Latest reply on Aug 23, 2007 1:47 AM by Blondel Michaël

    Ajax4jsfClient - fireAjaxEvent was not found

    Blondel Michaël Newbie

      I would like to use fireAjaxEvent.
      In the repeater example, i works fine. The tag a4j:support is inside an h:inputText like this :

      <h:inputText id="input_text" size="50" value="#{testBean.text}" >
       <a4j:support id="a4jsupport" event="onkeyup" reRender="rep"/>
      </h:inputText>
      <h:outputText value="#{testBean.text}" id="rep"/>
      
      


      But, I have a richfaces component like this :
      
       <h:form>
       <h:inputText value="#{testBean.productName}" id="productName" />
       <rich:suggestionbox id="productSuggestion" for="productName"
       suggestionAction="#{testBean.getProducts}" var="result"
       fetchValue="#{result.productName}"
       width="200" height="150" minChars="0">
       <h:column>
       <h:outputText value="#{result.productName}" />
       </h:column>
       <a4j:support id="a4jProductSuggestion" event="onselect" reRender="productName" />
       </rich:suggestionbox>
      
       </h:form>
      


      My test :
      ClientFacade client = new ClientFacade("/a4j/repeater.jsf");
      Ajax4jsfClient ajaxClient = new Ajax4jsfClient(client);
      ServerFacade server = new ServerFacade(client);
      client.setParameter("productName", new String[] {"test"});
      ajaxClient.fireAjaxEvent("a4jProductSuggestion");
      assertEquals("test", server.getManagedBeanValue("#{testBean.productName}"));
      


      I have this error :

      No component ID was found for a4jProductSuggestion
      
      org.jboss.jsfunit.facade.ComponentIDNotFoundException: No component ID was found for a4jProductSuggestion
      at org.jboss.jsfunit.facade.ClientIDs.findClientID(ClientIDs.java:141)
      at org.jboss.jsfunit.facade.ServerFacade.findClientID(ServerFacade.java:98)
      


      Can I use richfaces components ?
      Thanks