0 Replies Latest reply on Sep 23, 2011 5:06 AM by sridhar kosna

    rich:calendar date numbers are not being displayed

    sridhar kosna Newbie

      Hi All,

              I am richfaces3.3.3 with glassfish v3. i am creating htmlcaledar. it was being created but date numbers are not being displayed.

       

       

      and the Code is:

       

        FacesContext facesContext = FacesContext.getCurrentInstance();

              Application application = facesContext.getApplication();

             HtmlCalendar richCalendar =

                     (HtmlCalendar)application.createComponent(facesContext, HtmlCalendar.COMPONENT_TYPE, "org.richfaces.renderkit.html.CalenderRenderer");

      //       HtmlCalendar richCalendar = new HtmlCalendar();

       

              richCalendar.setZindex(CALENDAR_Z_INDEX);

              richCalendar.setEnableManualInput(true);

              richCalendar.setMode("client");

              richCalendar.setAjaxSingle(false);

              richCalendar.setReRender(RERENDER_STATIC_IDS_ON_DTONET_CHANGE);

       

              richCalendar.setDatePattern(

                      viewUtilities.getDateFormatForWorkingLocale());

       

           

              richCalendar.setInputClass(fieldStyleClass);

              // Set the ValueExpression for Locale.

              ValueExpression vExpLocale = FacesContext.getCurrentInstance().

                      getApplication().getExpressionFactory().createValueExpression(

                      FacesContext.getCurrentInstance().getELContext(),

                      "#{" + ManagedBeanNames.USER_SETTINGS_CONTROLLER + ".locale}",

                      Locale.class);

              richCalendar.setValueExpression("locale", vExpLocale);

              if(StringUtilities.isNotBlank(strJSSetDataChanged)) {

                  richCalendar.setOnchanged(strJSSetDataChanged);

                  richCalendar.setOninputkeypress(JS_PREFIX_CAPTURE_RETURN);

              }

              // Calendar component uses a converter to check if the given date

              // is convertable to the required pattern. Whatever message that appears

              // is because of the convertion error. So we set here a custom converter

              // message to override the richfaces converter message.

       

              Object[] dateFormatArgs = {

                  viewUtilities.getDateFormatForWorkingLocale() // i am getting the client format

              };

       

              richCalendar.setConverterMessage(ControllerUtils.getI18NString(

                      BundleConstants.PATH_INFOOBJECT, "Msg.validate.dateFormat",

                      dateFormatArgs));

              return richCalendar;

      }

      could anyone  please give me some suggestions?