2 Replies Latest reply on Aug 23, 2007 1:47 AM by mblondel

    Ajax4jsfClient - fireAjaxEvent was not found

    mblondel

      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

        • 1. Re: Ajax4jsfClient - fireAjaxEvent was not found
          ssilvert

          I think you are the first to try RichFaces with JSFUnit. I plan to look at it more closely after beta unless someone else wants to step up and get RichFaces support working sooner.

          Since RichFaces is based on ajax4jsf, there might not be that much work to do. But I'm just not sure because I haven't tried it.

          If I get some time I'll try to look at this a bit closer. Does <rich:suggestionbox> support having <a4j:support> nested inside?

          ComponentIDNotFoundException is telling you that no component ID ending in "a4jProductSuggestion" was found in the HTML. If you look at the HTML and see what was rendered you can tell if this is really the case.

          Regards,

          Stan Silvert
          http://www.jsfunit.org

          • 2. Re: Ajax4jsfClient - fireAjaxEvent was not found
            mblondel

            ok thanks
            i will have a look and I give you a feed back soon :)