3 Replies Latest reply on Apr 8, 2009 4:09 PM by gbadavidson

    A4j:commandbutton and A4J:commandlink not Navigating to next

    gbadavidson

      I have just started working with RichFaces and I am having what I hope is a simple problem on my part. I have working H:commandbutton and H:commandlink controls on a page. When these controls are pressed the application will navigate correctly based upon the action.

      What I did to load RichFaces. I went to the download site and downloaded the RichFaces imp. I copied the libs from RichFaces to the lib directory of the application. I modified my web.xml (shown below). I then copied the existing jsf commandbutton and commandlink controls and changed them to A4J: controls, leaving the original html controls there. When I ran the application the new contols do render and seem to be "clickable" yet they do not seem to do anything. The page does not navigate The original controls still function normally.

      Here is the web.xml file.

      <?xml version="1.0"?>
      <web-app version="2.5" xmlns="http://java.sun.com/xml/ns/javaee"
       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-app_2_5.xsd">
       <description>MiracleMind</description>
       <display-name>test</display-name>
       <context-param>
       <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
       <param-value>.xhtml</param-value>
       </context-param>
       <context-param>
       <param-name>facelets.REFRESH_PERIOD</param-name>
       <param-value>2</param-value>
       </context-param>
       <context-param>
       <param-name>facelets.DEVELOPMENT</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <param-name>javax.faces.STATE_SAVING_METHOD</param-name>
       <param-value>client</param-value>
       </context-param>
       <context-param>
       <param-name>com.sun.faces.validateXml</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
       <param-name>com.sun.faces.verifyObjects</param-name>
       <param-value>true</param-value>
       </context-param>
       <context-param>
      <param-name>org.ajax4jsf.VIEW_HANDLERS</param-name>
      <param-value>com.sun.facelets.FaceletViewHandler</param-value>
      </context-param>
       <servlet>
       <servlet-name>Faces Servlet</servlet-name>
       <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
       <load-on-startup>1</load-on-startup>
       </servlet><!-- Plugging the "Blue Sky" skin into the project -->
      <context-param>
      <param-name>org.richfaces.SKIN</param-name>
      <param-value>blueSky</param-value>
      </context-param>
      <!-- Making the RichFaces skin spread to standard HTML controls -->
      <context-param>
      <param-name>org.richfaces.CONTROL_SKINNING</param-name>
      <param-value>enable</param-value>
      </context-param>
      <!-- Defining and mapping the RichFaces filter -->
      <filter>
      <display-name>RichFaces Filter</display-name>
      <filter-name>richfaces</filter-name>
      <filter-class>org.ajax4jsf.Filter</filter-class>
      </filter>
      <filter-mapping>
      <filter-name>richfaces</filter-name>
      <servlet-name>Faces Servlet</servlet-name>
      <dispatcher>REQUEST</dispatcher>
      <dispatcher>FORWARD</dispatcher>
      <dispatcher>INCLUDE</dispatcher>
      </filter-mapping>
       <servlet-mapping>
       <servlet-name>Faces Servlet</servlet-name>
       <url-pattern>*.jsf</url-pattern>
       </servlet-mapping>
      
       <welcome-file-list>
       <welcome-file>index.jsp</welcome-file>
       <welcome-file>index.jsf</welcome-file>
      
       </welcome-file-list>
      
      </web-app>
      


      <!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:h="http://java.sun.com/jsf/html"
       xmlns:f="http://java.sun.com/jsf/core"
       xmlns:ui="http://java.sun.com/jsf/facelets"
       xmlns:a4j="http://richfaces.org/a4j">
      
      
       <f:loadBundle basename="resources" var="msg" />
      
      
       <ui:composition template="/templates/layout.xhtml">
       <ui:define name="content">
       <h:form>
       <h:outputLabel for="userName" value="#{msg.userNamePrompt}"/>
       <h:inputText value="#{authenticate.userName}" id="userName" maxlength="20" required="true"/>
       <h:message for="userName"/>
       <br/>
       <h:outputLabel for="password" value="#{msg.passwordPrompt}"/>
       <h:inputSecret id="password" value="#{authenticate.password}" maxlength="20" required="true"/>
       <h:message for="password"/>
      
       <br/>
       <br/>
       <h:commandLink action="forgotpassword" value="Forgot your User Name of Password?" immediate="true"/>
       <br/>
       <br/>
       <h:commandButton action="#{authenticate.submitLogin}" value="Submit your password"/>
       <br/>
       <br/>
       <a4j:commandLink action="forgotpassword" value="Forgot your User Name of Password?" immediate="true"/>
       <br/>
       <br/>
       <a4j:commandButton action="#{authenticate.submitLogin}" value="Submit your password"/>
      
       </h:form>
       </ui:define>
       </ui:composition>
      
      </html>