2 Replies Latest reply on Apr 16, 2009 12:06 AM by Christopher Logan

    rich:calendar dataModel in seam

    Christopher Logan Newbie
      Hi,
      my env is:
      Seam 2.1.1.GA
      JBoss 4.2.3.GA
      jdk1.5.0_15
      RichFaces version bundled with Seam 2.1.1.GA.

      I'm using the rich:calendar tag in a SEAM application.  I have a war file and the dataModel was defined in a jar file that I have included both in an ear file.  I'm referencing the example at:
      http://livedemo.exadel.com/richfaces-demo/richfaces/calendar.jsf?c=calendar&tab=usage

      I made a component out of the CalendarDataModel so that it will resolve to the CalendardataModelImpl class as seen here:

      @Name("calendarDataModel")
      public class CalendarDataModelImpl implements CalendarDataModel {
      :
      }

      But I get the following error in the web application:

      javax.el.PropertyNotFoundException: /acct/calendar/calendarIndex.xhtml @69,84 value="#{calendarDataModel.currentShortDescription}": Target Unreachable, identifier 'calendarDataModel' resolved to null

      But the calendarBean packaged in the same jar is recognized.

      Is there anything I missed?  Please advise.
      -Christopher
        • 1. Re: rich:calendar dataModel in seam
          Christopher Logan Newbie
          in order to resolve the issue I moved common-beanutils.jar and richfaces-api.jar to the lib directory of the ear file.

          I'm now able to see the calendarDataModel working initially and all the day items get loaded correctly.
          Now, I tried to update a day item, I get the following error after I click on "Store" on the "Edit day:" popup:

          Caused by javax.el.PropertyNotFoundException with message: "/acct/calendar/calendarIndex.xhtml @69,84 value="#{calendarDataModel.currentShortDescription}": Target Unreachable, identifier 'calendarDataModel' resolved to null"

          It seems like the calendarDataModel went out of scope and seam can't find it.
          • 2. Re: rich:calendar dataModel in seam
            Christopher Logan Newbie
            I answered my own post.
            Like I said it seems like the calendarDataModel went out of scope and it did.
            Just set the scope type when outjecting the data model:

            @Out(scope=ScopeType.SESSION)
            private CalendarDataModel calendarDataModel = CalendarDataModelImpl.getInstance();

            -Christopher