0 Replies Latest reply on Nov 21, 2007 5:26 AM by Charles Brands

    Using the calandar without a backing bean

    Charles Brands Newbie

      At this moment I have a Calendar working in the following manner

      <a4j:outputPanel id="calendar" layout="block">
       <rich:calendar
       id="Date"
       popup="true"
       datePattern="MMM d, yyyy"
       value="#{calendarBean.date}"
       valueChangeListener="#{calendarBean.selectDate}">
       <a4j:support event="ondateselected"/>
       </rich:calendar>
      </a4j:outputPanel>
      

      The backing bean constist of a private date variable with getters and setters and
      public void selectDate(ValueChangeEvent event) {
       Date newDate = (Date) event.getNewValue();
       if (newDate != null) {
       setDate(newDate);
       }
      }
      


      The good news it works. The bad news this is not consistent with the general architecture of our project.

      I would like to get rid of the backing bean and write directly to the domain object.

      The problem is in the javax.faces.event.ValueChangeEvent. Naturally I don't want the domain layer to know about jsf.

      Is it possibel to set the date without resorting to javax.faces.event.ValueChangeEvent?
      It is kind of sad that I need the backing bean only for converting the event to a date.
      Thanks