title: RichFaces 4 - <a4j:ajax ...> Javascript "RichFaces not found"
body: <p>Sorry for the question title, but I couldn't figure out a better one.</p>
  
  <p>I'm using JSF 2.0 (MyFaces 2.0.2) and added RichFaces 4 (4.0.0.20101004-M3) to my project.
  I found an example with RichFaces 4 (http://java.sys-con.com/node/1098139) and created a xhtml-page with the following code:</p>
  
  <pre><code>&lt;ui:define name="webpage_main_body"&gt;
      &lt;h:form&gt;
          &lt;h:panelGrid columns="2"&gt;
              &lt;h:outputText value="Text:" /&gt;
                  &lt;h:inputText value="#{echoBean.text}"&gt;
                      &lt;a4j:ajax event="keyup" render="text,count"
                          listener="#{echoBean.countListener}" /&gt;
                  &lt;/h:inputText&gt;
                  &lt;h:outputText value="Echo:" /&gt;
                  &lt;h:outputText id="text" value="#{echoBean.text}" /&gt;
                  &lt;h:outputText value="Count:" /&gt;
                  &lt;h:outputText id="count" value="#{echoBean.count}" /&gt;
              &lt;/h:panelGrid&gt;
          &lt;/h:form&gt;
  &lt;/ui:define&gt;
  </code></pre>
  
  <p>As this is a Facelets page, it uses a template which defines a header (including a logo and the main navigation).</p>
  
  <p>If i'm opening the page in my browser, it gets rendered correctly. The resulting HTML code of the inputbox is as follows:</p>
  
  <pre><code>    &lt;input type="text" 
  onkeyup="RichFaces.ajax(&amp;quot;j_id1176210999_514e0f6c:j_id1176210999_514e0fad&amp;quot;,event,{&amp;quot;parameters&amp;quot;:{&amp;quot;javax.faces.behavior.event&amp;quot;:&amp;quot;keyup&amp;quot;} } )" value="" name="j_id1176210999_514e0f6c:j_id1176210999_514e0fad" id="j_id1176210999_514e0f6c:j_id1176210999_514e0fad"&gt;
  </code></pre>
  
  <p>The problem is, if I enter something into the textbox, it should fire an ajax-reqest on every keyup using a Javascript-function called "RichFaces.ajax(...)". However everytime the event is fired, the Firefox Error-Console prints an Error:</p>
  
  <pre><code>Error: RichFaces is not defined
  Source File: http://localhost:8080/project/richEchoTest.xhtml
  Line: 1
  </code></pre>
  
  <p>To my question: Has anyone have an idea where this RichFaces-Javascript-Object is defined? Or is there anything i have to include within the xhtml-pages? I only included the "xmlns:a4j="http://richfaces.org/a4j", do i have to add the "xmlns:rich...." too?</p>
  
  <p>Thanks in advance, I'd really appreciate any help, cause I already wasted 3 days looking into the problem.</p>
  
  <p>//EDIT:
  I forgot to mention that if I use the built-in jsf2 ajax-tag it works like a charm:</p>
  
  <pre><code>  &lt;f:ajax event="keyup" execute="@form" render="text count" 
  listener="#{echoBean.countListener}" /&gt;
  </code></pre>