5 Replies Latest reply on Oct 23, 2007 12:45 PM by fabmars

    rich:calendar and calendar objects

    fabmars

      Hi

      We're using (Gregorian)Calendars in our data model and we'd like to use rich:calendar without having to convert manually our Calendars to Dates and vice-versa.

      We cannot really use a converter since it does object to string and string to object.

      Wouldn't it be nice to bind calendars as well as dates in the rich:calendar component ?

        • 1. Re: rich:calendar and calendar objects
          ilya_shaikovsky

          Update your RF version. This improvement was already made.

          • 2. Re: rich:calendar and calendar objects
            fabmars

            Hi
            I'm sorry but this is not the case. I checked with last friday's snapshot, and here is what I have :

            /pages/test.xhtml @15,49 value="#{fakeData.calValue}": Can't set property 'calValue' of type 'java.util.Calendar' on class 'com.xxx.xxx.xxx.fake.FakeData' to value '4/10/07 0:00'.


            Here is my test.xhtml page :

            <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
            <html xmlns="http://www.w3.org/1999/xhtml"
             xmlns:h="http://java.sun.com/jsf/html"
             xmlns:f="http://java.sun.com/jsf/core"
             xmlns:ui="http://java.sun.com/jsf/facelets"
             xmlns:a4j="http://richfaces.org/a4j"
             xmlns:rich="http://richfaces.org/rich">
            
            
             <ui:composition template="/templates/admin.xhtml">
            
             <ui:define name="content">
             <h:form>
             <h:panelGroup>
             <rich:calendar value="#{fakeData.calValue}"></rich:calendar>
            
             <h:commandButton action="null" value="SUBMIT"></h:commandButton>
             </h:panelGroup>
             </h:form>
             </ui:define>
            
             </ui:composition>
            
            </html>
            


            Here is my backing bean :

            package com.xxx.xxx.xxx.fake;
            
            import java.util.Calendar;
            
            public class FakeData {
            
             private Calendar calValue;
            
             public Calendar getCalValue() {
             return calValue;
             }
            
             public void setCalValue(Calendar calValue) {
             this.calValue = calValue;
             }
            
            }
            


            Just in case, I checked using a more specific GregorianCalendar instead of just Calendar and uit doesn't work either.

            Is there anything I'm doing that's wrong ? Can you help me ?

            • 3. Re: rich:calendar and calendar objects
              fabmars

              No answer ?

              • 4. Re: rich:calendar and calendar objects
                ilya_shaikovsky

                What is precise version number? I'm succesfully use calendar type from 3.1.2 GA,

                • 5. Re: rich:calendar and calendar objects
                  fabmars

                  October 12, but it was after you told me it was fixed.
                  We've upgraded to RF 3.1.2 now. I'll retest asap.
                  thanks.