7 Replies Latest reply on Dec 7, 2008 7:31 PM by Val Sw

    rich:calendar, how to display current date on Create screen

    Val Sw Expert

      I need to display current date as default value in rich:calendar when the page loads on create screen.

      Please suggest how this can be achieved, any trick....

      I tried adding label="#{currentDatetime}", we need to keep value="#{projectHome.instance.projectDateElement}" as it is mapped to database column.

      Changing value="#{currentDatetime}" displays the current date on create screen.

      <s:decorate id="projectDateElementDecoration" template="layout/edit.xhtml">
      <ui:define name="label">Project Date</ui:define>
      <rich:calendar id="projectDateElement"
      value="#{projectHome.instance.projectDateElement}" datePattern="MM/dd/yyyy"/>