1 2 Previous Next 19 Replies Latest reply on Nov 2, 2007 6:05 PM by Alexander N/A

    a4j:include + calendar = serious bug ?

    Bruno Arruda Newbie

      Hi ppl,

      I will not make the mistake I made on trying to explain the problem on my application again. So, I builded a new simple project that you can download:

      I´m using richfaces 3.1.1 and IE or FF(error on both)

      Eclipse project:
      http://74.86.67.56/teste/RichTest.zip

      WAR file:
      http://74.86.67.56/teste/RichTest.war

      The problem is, when I control the page inside the a4j:include via manage bean, and i try to reRender a panel, the rich:calendar inside the new page is not loaded correctly, it has a javascript problem and I get a error when I click on it:

      "$("includedPage:a4jInclude1:j_id_jsp_1105707755_0pc2:insertProcessCalendar1").component has no properties"

      BUT, if I click on the link again, the calendar is rendered fine on the second time.

      I don´t think this is a rich:calendar problem, because I´ve saw this problem with others javascripts.

      PS.: If you want to test the BUG multiple times you need to clean the brownser´s cache.

      I hope this helps... Thanks again


      Here comes the codes if you do´nt want to download the project:


      TestMB

      
      package manage;
      
      import java.util.Date;
      
      public class TestMB
      {
       private Date testDate;
       private String page = "/defaultInside.jsp";
      
       public TestMB()
       {
       }
      
       public void changePage( )
       {
       this.page = "/newInside.jsp";
       }
      
       public String getPage()
       {
       return page;
       }
      
       public void setPage(String page)
       {
       this.page = page;
       }
      
       public Date getTestDate()
       {
       return testDate;
       }
      
       public void setTestDate(Date testDate)
       {
       this.testDate = testDate;
       }
      }
      
      



      main.jsp
      
      <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
      <%@taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
      <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
      
      <html>
      <body>
      <f:view>
      
       <h:form>
       <a4j:commandLink value="Change Page" action="#{test.changePage}" reRender="mainPanel2" />
       </h:form>
      
      
      
       <h:panelGrid id="mainPanel2">
       <h:panelGroup id="mainCustomerPanelGroup2">
       <f:subview id="includedPage">
       <a4j:include viewId="#{test.page}" id="a4jInclude1" />
       </f:subview>
       </h:panelGroup>
       </h:panelGrid>
      
      </f:view>
      
      </body>
      </html>
      
      


      defaultInside.jsp
      Default Content Text
      


      newInside.jsp
      
      <%@taglib uri="http://java.sun.com/jsf/html" prefix="h"%>
      <%@taglib uri="http://java.sun.com/jsf/core" prefix="f"%>
      <%@taglib uri="https://ajax4jsf.dev.java.net/ajax" prefix="a4j"%>
      <%@taglib uri="http://richfaces.ajax4jsf.org/rich" prefix="rich"%>
      <%@taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
      
      <h:form>
       <rich:calendar id="insertProcessCalendar1" immediate="true" required="true" value="#{testMB.expirationDate}" />
      </h:form>
      
      







        1 2 Previous Next