2 Replies Latest reply on Apr 14, 2009 5:52 AM by Nick Belaevski

    New to richfaces problem with a4j:support on a graphic image

    Matt Carrier Newbie

      Hi all,

      I am new to rich faces and a4j and am having a problem trying to link a graphic image with a4j support. I am currently using rich faces 3.3.0.GA with facelets and myfaces on tomcat 6. I am trying to call a method in my backing bean after an onclick event. No stack trace is thrown on tomcat and IE shows a javascript error (Object Required) in ajaxscript.faces, firefox shows no such error. any help would be greatly appreciated.

      Here is my xhtml code

      <ui:composition id="c"
      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:a4j="http://richfaces.org/a4j"
      xmlns:rich="http://richfaces.org/rich">
      <f:view id="jacksOrBetterView">
      <h:outputText id="imageOneHold" rendered="#{jacksOrBetterBean.isCardOneHeld}" style="background: red" value="HELD"/>
      <h:graphicImage id="cardOne" value="#{jacksOrBetterBean.cardOneImagePath}">
      <a4j:support
      event="onclick"
      actionListener="#{jacksOrBetterBean.cardOneHeldAction}"
      reRender="cardOne"
      limitToList="true"/>
      </h:graphicImage>
      </f:view>
      </ui:composition>

      here is my faces-config.xml

      <faces-config xmlns="http://java.sun.com/JSF/Configuration">

      <view-handler>
      com.sun.facelets.FaceletViewHandler
      </view-handler>


      <managed-bean>
      <managed-bean-name>jacksOrBetterBean</managed-bean-name>
      <managed-bean-class>com.cskids.virtualcasino.ui.beans.JacksOrBetterBean</managed-bean-class>
      <managed-bean-scope>session</managed-bean-scope>
      </managed-bean>
      </faces-config>

      and here is my web.xml

      <?xml version="1.0"?>
      <!DOCTYPE web-app PUBLIC
      "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN"
      "http://java.sun.com/dtd/web-app_2_3.dtd">
      <web-app>
      <!-- Use Documents Saved as *.xhtml -->
      <context-param>
      <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
      <param-value>.xhtml</param-value>
      </context-param>

      <context-param>
      <param-name>facelets.DEVELOPMENT</param-name>
      <param-value>true</param-value>
      </context-param>

      <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>blueSky</param-value>
      </context-param>

      <context-param>
      <param-name>org.richfaces.CONTROL_SKINNING</param-name>
      <param-value>enable</param-value>
      </context-param>


      <display-name>RichFaces Filter</display-name>
      <filter-name>richfaces</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>


      <filter-mapping>
      <filter-name>richfaces</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      REQUEST
      FORWARD
      INCLUDE
      </filter-mapping>


      <servlet-name>Faces Servlet</servlet-name>
      <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
      <load-on-startup>1</load-on-startup>

      <servlet-mapping>
      <servlet-name>Faces Servlet</servlet-name>
      <url-pattern>*.faces</url-pattern>
      </servlet-mapping>
      <welcome-file-list>
      <welcome-file>welcome.jsp</welcome-file>
      </welcome-file-list>
      </web-app>