4 Replies Latest reply on Aug 31, 2007 3:36 PM by ericomtx

    Ajax4JSF and Facelets


      I'm trying to use ajax4jsf with facelets

      In a user.xhtml file I have :

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <t:document xmlns="http://www.w3.org/1999/xhtml"

      <ui:composition template="/template/template.xhtml">

      In my template.xhtml I have a4jsf declared too

      In my user.xhtml I tryied to implement an example :

      <a4j:region id="stat1">
      <h:inputText id="usr">
      <a4j:support event="onkeyup" />
      <a4j:status startText=" Performing Request"
      stopText=" Request Done" for="stat1">

      When I digit something in the inputText I get the following error in my browser :

      A4J is not defined

        • 1. Re: Ajax4JSF and Facelets

          may be you have no filter declared in the web.xml

          • 2. Re: Ajax4JSF and Facelets


            <display-name>Ajax4jsf Filter</display-name>


            I have other filters from shale and MyFaces declared in my web.xml
            Could one of them or their properties as mapping intervene in ajax4jsf filter ?

            • 3. Re: Ajax4JSF and Facelets

              In general, "A4J is not defined" means the javascript is not loaded. The script is generated by filter. For myFaces, you need to have a a4j:page tag declared right after f:view. If you do not, it might be the problem. You declare that only *.jsf are comes thru the filter. So, if the particular pages does not, it also might be the problem.
              The earlier version of shale used to have bug that causes the problem of integration. However, I did not see about any conflict for long period of time.
              Search the Internet for the proven web.xml declaration. If I remember correctly, MyFaces wiki has something like that.

              • 4. Re: Ajax4JSF and Facelets

                The problem was the integration with Shale

                I was using the 1.0.4 and changed to 1.0.3 as you said

                It's working ok now

                Thanks !!!