11 Replies Latest reply on May 12, 2010 8:06 PM by Nick Belaevski

    set doesn't called for attribute of new component

    Igor Grinfeld Newbie

      I use inputDate example to create new component with richFaces CDK. It is named 'WeeklyCalendar' and should display week schedule. It has dataModel attribute in similar as usual calendar has. However, when I try to use it with JSF, no set or get methods are called for dataModel attribute. I've added printings into component and datamodel classes and it shows me that set methods of all attributes except dataModel are called. Can somebody explain me what wrong?

       

      The code attached.

       

      code from main project that is not included in jar:

       

      faces-config.xml:

       

      <CODE>

      <managed-bean>

       

      <managed-bean-name>testCalendarBean</managed-bean-name>

       

      <managed-bean-class>components.testClasses.WeeklyCalendarTestBean</managed-bean-class>

       

      <managed-bean-scope>session</managed-bean-scope>

       

      </managed-bean>

       

      </CODE>

       

      log4j.properties:

      <CODE>

      log4j.rootLogger=

      error, stdout

       

       

      log4j.appender.stdout=

      org.apache.log4j.ConsoleAppender

      log4j.appender.stdout.layout=

      org.apache.log4j.PatternLayout

      log4j.appender.stdout.layout.ConversionPattern=

      %d %-5p (%30F:%L) %3x - %m%n

       

      log4j.appender.components=

      org.apache.log4j.RollingFileAppender

      log4j.appender.components.File=

      C:\\richComponents.log

      log4j.appender.components.MaxFileSize=

      10000KB

      log4j.appender.components.MaxBackupIndex=

      10000

      log4j.appender.components.layout=

      org.apache.log4j.PatternLayout

      log4j.appender.components.layout.ConversionPattern=

      %d [%t] %p %c - %m%n

       

       

      log4j.logger.com.sintecmedia.components =

      debug, components

      log4j.logger.components.testClasses =

      debug, components

       

      log4j.logger.com.sintecmedia =

      info, stdout

      </CODE>

       

      tesComponents.jsp:

      <CODE>

      <%@

       

      taglib uri="http://java.sun.com/jsf/html" prefix="h"%>

      <%@

       

      taglib uri="http://java.sun.com/jsf/core" prefix="f"%>

      <%@

       

      taglib uri="http://sintecmedia.com/richComponents" prefix="my"%>

       

      <

       

      html>

       

      <head>

       

      <title>My inputDate</title>

       

      </head>

       

      <body>

       

      <f:view>

       

      <h:form>

       

      <br/>Before calendar 5<br/>

       

      <my:weeklyCalendar value="#{4/4/10}" dataModel="#{testCalendarBean.model}" startDay="2">

       

      <f:facet name="caption">

       

      <f:verbatim>

      Calendar:

       

      </f:verbatim>

       

      </f:facet>

       

      </my:weeklyCalendar>

       

      <br/>After calendar<br/>

       

      <h:commandButton value="Submit" />

       

      </h:form>

       

      </f:view>

       

      </body>

      </

       

      html>

      </CODE>

       

      WeeklyCalendarTestBean.java:

      <CODE>

      package components.testClasses;

      import org.apache.log4j.Logger;

      import com.sintecmedia.components.datamodels.WeeklyCalendarModel;
      import com.sintecmedia.components.datamodels.impl.WeeklyCalendarModelImpl;
      import com.sintecmedia.components.datamodels.impl.WeeklyCalendarModelItemImpl;

      public class WeeklyCalendarTestBean {
      private static final Logger LOG =
        Logger.getLogger( WeeklyCalendarTestBean.class );

       

      private WeeklyCalendarModel clndr =
        new WeeklyCalendarModelImpl( 1, 4, 600, 900, 30 );

       

      public WeeklyCalendarTestBean() {
        LOG.error( "TestBean constructor" );
        clndr.putItemToSlot( new WeeklyCalendarModelItemImpl( "test" ), 1, 1 );
      }

       

      public WeeklyCalendarModel getModel() {
        LOG.error( "TestBean model" );
        return clndr;
      }

       

      }

      </CODE>