4 Replies Latest reply on Oct 12, 2007 5:55 AM by abelevich

    Getting Javascript error A4J is undefined

    mbedry2

      I have setup the sample page as per the instructions in Developer guide using facelets in WebSphere 6 and when I execute the page in IE 7 I get a javascript error A4J is undefined.

      According to the pagesource

      <input type="text" name="_id22:_id23" onkeyup="A4J.AJAX.Submit('_viewRoot','_id22',event,{'actionUrl':'/WorkManagement/pages/maintainschedules/test1.xhtml','parameters':{'_id22:_id24':'_id22:_id24'} } )" size="50" />

      it is trying to execute A4J.AJAX.Submit js method which exits in AJAX.js and it is in the richfaces jar file.

      How do I get the xhtml page to find this file?

      Here is a copy of the sample xhtml file that I am trying to run.

      <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
      <html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:hx="http://www.ibm.com/jsf/html_extended"
      xmlns:pdc="http://pdc.can.ibm.com" xmlns:a4j="http://richfaces.org/a4j">

      <ui:composition
      template="/WEB-INF/global/facelets/templates/workManagementPage.xhtml">
      <ui:define name="EPHScontentColumn">

      <f:loadBundle var="maintainSchedulesText"
      basename="com.ibm.pdc.ephs.workmanagement.nl.maintainSchedules.MaintainSchedulesBundle" />
      <f:loadBundle var="commonText"
      basename="com.ibm.pdc.ephs.workmanagement.nl.CommonBundle" />
      <hx:scriptCollector id="scriptCollector1">
      <h:form>
      <h:inputText size="50" value="#{dataManager.text1}">
      <a4j:support event="onkeyup" reRender="rep" />
      </h:inputText>
      <h:outputText value="#{dataManager.text1}" id="rep" />
      </h:form>
      </hx:scriptCollector>
      <!-- NOTE: Make sure to include this script AFTER the scriptCollector -->

      </ui:define>
      </ui:composition>