1 2 Previous Next 25 Replies Latest reply on May 27, 2009 5:06 AM by Ilya Shaikovsky

    Components unresponsive

    Chris Baxter Newbie

      I recently upgraded my RichFaces version from 3.0.1 to 3.1.0. In doing so, I have seen that some of my components (tabs on a rich tab panel, checkboxes with nested a4j support) have become unresponsive to click events. Sometimes they recognize the click and perform the correct axis call to the back end and some times they do not. Has anyone else noticed this behavior in the latest version? Any thoughts on what might be causing it?

        • 1. Re: Components unresponsive
          Raj Rajendran Newbie

          I noticed the same behaviour as well and have reverted back to 3.0.1

          • 2. Re: Components unresponsive
            Sergey Smirnov Master

            Guys, your comments are very unhelpful

            All my examples from 3.0.1 just works fine in 3.1.0. So what?

            • 3. Re: Components unresponsive
              Chris Baxter Newbie

              I just wanted to see if other people had been experiencing these issues. I will be posting a code sample tomorrow if that helps.

              • 4. Re: Components unresponsive
                Chris Baxter Newbie

                Okay, as promised, here's my example. When the page loads, type in a value into the 'Code' field and click the 'Lookup Code' button. A tab panel should show up now. In the first tab, there is a checkbox with a4j:support nested in it. When you click the box, it should change the 'message' property of the TestBean class and re-render the message displayed under the checkbox. What I'm seeing when I try to do this is that it doesn't always recognize the changing of the checkbox. Sometimes I can change it mulitple times before it finally does the onchange ajax call. When I use richfaces 3.0.1 with a seperate ajax4jsf jar everything works exactly as expected, not missing one event. Can you please tell me what I'm doing wrong here or why this no longer works in the new Rich Faces version? Thanks.

                The .xhtml page is as follows:

                <html xmlns:ui="http://java.sun.com/jsf/facelets"
                 xmlns:rich="http://richfaces.ajax4jsf.org/rich"
                 xmlns:f="http://java.sun.com/jsf/core"
                 xmlns:h="http://java.sun.com/jsf/html"
                 xmlns:a4j="https://ajax4jsf.dev.java.net/ajax"
                 xmlns:c="http://java.sun.com/jstl/core">
                 <ui:composition>
                 <h:form id="TestForm">
                 <!-- Table that holds the Vendor Lookup section -->
                 <table width="750">
                 <tr>
                 <td>
                 <rich:panel>
                 <table>
                 <tr>
                 <td>Code:
                 <h:inputText size="10" id="Code" value="#{TestBean.code}"/>
                 <h:commandButton action="#{TestBean.lookupCode}" value="Lookup Code"/>
                 </td>
                 <td width="10%"/>
                 <td>Name:
                 <h:inputText size="30" id="Name" value="#{TestBean.name}"/>
                 <h:commandButton value="Clear"
                 action="#{TestBean.clearCode}"/>
                 </td>
                 </tr>
                 </table>
                 </rich:panel>
                 </td>
                 </tr>
                 </table>
                
                 <!-- Table that holds the tabs -->
                 <h:panelGroup id="TabArea" rendered="#{!empty TestBean.code}">
                 <table width="750">
                 <tr>
                 <td>
                 <rich:tabPanel switchType="ajax">
                 <rich:tab label="Tab 1">
                 <f:subview id="Tab1Subview">
                 <table>
                 <tr>
                 <td align="right">Click to change text:</td>
                 <td>
                 <h:selectBooleanCheckbox id="Checkbox" value="#{TestBean.checkbox}">
                 <a4j:support event="onchange" action="#{TestBean.checkboxChanged}" reRender="MessageText"/>
                 </h:selectBooleanCheckbox>
                 </td>
                 </tr>
                 <tr>
                 <td>
                 <h:outputText id="MessageText" value="#{TestBean.message}"/>
                 </td>
                 </tr>
                 </table>
                 </f:subview>
                 </rich:tab>
                 <rich:tab label="Tab 2">
                 Here is Tab 2
                 </rich:tab>
                 <rich:tab label="Tab 3">
                 Here is Tab 3
                 </rich:tab>
                 <rich:tab label="Tab 4">
                 Here is Tab 4
                 </rich:tab>
                 <rich:tab label="Tab 5">
                 Here is Tab 5
                 </rich:tab>
                 <rich:tab label="Tab 6">
                 Here is Tab 6
                 </rich:tab>
                 <rich:tab label="Tab 7">
                 Here is Tab 7
                 </rich:tab>
                 <rich:tab label="Tab 8">
                 Here is Tab 8
                 </rich:tab>
                 </rich:tabPanel>
                 </td>
                 </tr>
                 </table>
                 </h:panelGroup>
                 </h:form>
                 </ui:composition>
                </html>


                The java class used is as follows:

                package com.ati.test;
                
                public class TestBean {
                 private String code;
                 private boolean checkbox;
                 private String name;
                 private String message = "The checkbox is unchecked";
                
                 /**
                 * Gets the checkbox
                 * @return boolean
                 */
                 public boolean isCheckbox() {
                 return checkbox;
                 }
                 /**
                 * Sets the checkbox
                 * @param checkbox The checkbox to set.
                 */
                 public void setCheckbox(boolean checkbox) {
                 this.checkbox = checkbox;
                 }
                 /**
                 * Gets the code
                 * @return String
                 */
                 public String getCode() {
                 return code;
                 }
                 /**
                 * Sets the code
                 * @param code The code to set.
                 */
                 public void setCode(String code) {
                 this.code = code;
                 }
                 /**
                 * Gets the name
                 * @return String
                 */
                 public String getName() {
                 return name;
                 }
                 /**
                 * Sets the name
                 * @param name The name to set.
                 */
                 public void setName(String name) {
                 this.name = name;
                 }
                
                 /**
                 * Gets the message
                 * @return String
                 */
                 public String getMessage() {
                 return message;
                 }
                 /**
                 * Sets the message
                 * @param message The message to set.
                 */
                 public void setMessage(String message) {
                 this.message = message;
                 }
                 public String lookupCode(){
                 System.out.println("Call has been made to lookup code...");
                 return "test";
                 }
                
                 public String checkboxChanged(){
                 System.out.println("Checkbox has been changed...");
                 if (checkbox){
                 message = "The checkbox is checked";
                 }
                 else{
                 message = "The checkbox is unchecked";
                 }
                 return "";
                 }
                
                 public String clearCode(){
                 System.out.println("Clearing code...");
                 code = null;
                 return "test";
                 }
                }
                


                The web.xml is as follows:

                <?xml version="1.0" encoding="UTF-8"?>
                
                <web-app 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/web-app_2_5.xsd"
                 version="2.5">
                
                 <display-name>Test Application</display-name>
                
                 <listener>
                 <listener-class>org.apache.myfaces.webapp.StartupServletContextListener</listener-class>
                 </listener>
                
                 <context-param>
                 <param-name>javax.faces.DEFAULT_SUFFIX</param-name>
                 <param-value>.xhtml</param-value>
                 </context-param>
                 <context-param>
                 <param-name>org.richfaces.SKIN</param-name>
                 <param-value>blueSky</param-value>
                 </context-param>
                
                 <servlet>
                 <display-name>FacesServlet</display-name>
                 <servlet-name>FacesServlet</servlet-name>
                 <servlet-class>javax.faces.webapp.FacesServlet</servlet-class>
                 <load-on-startup>1</load-on-startup>
                 </servlet>
                 <servlet-mapping>
                 <servlet-name>FacesServlet</servlet-name>
                 <url-pattern>*.jsf</url-pattern>
                 </servlet-mapping>
                
                 <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>FacesServlet</servlet-name>
                 <dispatcher>REQUEST</dispatcher>
                 <dispatcher>FORWARD</dispatcher>
                 <dispatcher>INCLUDE</dispatcher>
                 </filter-mapping>
                </web-app>


                The faces-config.xml is as follows:

                <?xml version='1.0' encoding='UTF-8'?>
                
                <!--
                 Copyright 2004 Sun Microsystems, Inc. All rights reserved.
                 SUN PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
                -->
                <faces-config>
                
                 <application>
                 <view-handler>com.sun.facelets.FaceletViewHandler</view-handler>
                 </application>
                
                 <navigation-rule>
                 <navigation-case>
                 <from-outcome>test</from-outcome>
                 <to-view-id>/site/testPage.xhtml</to-view-id>
                 </navigation-case>
                 </navigation-rule>
                
                 <managed-bean>
                 <managed-bean-name>TestBean</managed-bean-name>
                 <managed-bean-class>com.ati.test.TestBean</managed-bean-class>
                 <managed-bean-scope>session</managed-bean-scope>
                 </managed-bean>
                </faces-config>


                • 5. Re: Components unresponsive
                  Sergey Smirnov Master

                  does it make any changes if you remove rendered="#{!empty TestBean.code}" from the panelGroup ?

                  • 6. Re: Components unresponsive
                    Sergey Smirnov Master

                    Ok, Update: we took you code in blank RichFaces 3.1.0 project and ran under the different profiles (JSF 1.1, JSF 1.2, MyFaces). Works just well everywhere. We even tried different filters. No luck. Still works.

                    Can you send the test war file? Look likes the problem is outside of the snippets you sent.

                    • 7. Re: Components unresponsive
                      Chris Baxter Newbie

                      If I remove the rendered attribute the checkbox works as before. But like I said, in the old version it worked with the rendered attribute. Where can I send the WAR to? BTW, I'm using JBoss 4.0.4 GA if that matters at all.

                      • 9. Re: Components unresponsive
                        Chris Baxter Newbie

                        Okay, I have attached the WAR to the JIRA issue. Let me know what you're findings are. I appreciate the help.

                        • 10. Re: Components unresponsive
                          Sergey Smirnov Master

                          We test it.

                          Do you test it with IE only?

                          • 11. Re: Components unresponsive
                            Chris Baxter Newbie

                            No. I tested wit both IE and Firefox. Same results regardless of the browser used.

                            • 12. Re: Components unresponsive
                              Sergey Smirnov Master

                              Your war file works fine on our side. Only difference between the FF and IE, that onchange in IE is fired only when user left the field.

                              So, war did not bring the clarification.

                              Last question - do you have any other application(s) deployed to the same Jboss server?

                              • 13. Re: Components unresponsive
                                Chris Baxter Newbie

                                I don't have any other applications deployed besides this one. I installed JBoss 4.0.4 GA using the default server profile. The only custom thing I added after I set up the server was a datasource xml file. What version were you testing the WAR with?

                                1 2 Previous Next