7 Replies Latest reply on Mar 26, 2009 2:30 AM by allanjun

    Create rich:calendar programmatically

    allanjun

      Hi there,

      I'm having a problem of creating a rich:calendar component from Java, I got an "Component xxxx not instance of org.richfaces.component.UICalendar" exception.

      The way I created is as follow:
      publi class Test {
      public HtmlPanelGrid getViewPanel() {
      HtmlPanelGrid viewPanel = new HtmlPanelGrid();
      HtmlCalendar calendar = new HtmlCalendar();
      calendar.setPopup(true);
      calendar.setDatePattern("dd/MM/yyyy");
      calendar.setValue(new Date());
      viewPanel.getChildren().add(calendar);
      }
      }


      and I then bind it to a <h:panelGrid binding="#{test.viewPanel}"/>

      I notice that the source code of a working rich:calendar is quite complicated than just a tag which was generated by the above java code.

      So, how do I create a rich:calendar from java then?

      Thanks.