0 Replies Latest reply on May 31, 2011 10:42 AM by Mario Marques Junior

    richfaces 4 <rich:calendar> with data model support and view parameters

    Mario Marques Junior Newbie

      I'm using richfaces 4 <rich:calendar> with data model support in two JSF2 pages, create.xhtml and view.xhtml. The "create" page don't have view parameters and calendar works (reloads data model "oncurrentdateselect"). Yet, the "view" page don't, and I think that's because of the view parameters. I've already included some inputHidden's that are used on another fields that rely on ajax. How can I use this structure and have the data model updating in my "view" page? Thanks.

       

      --------------

      create.xhtml

      --------------

      <f:metadata>

      </f:metadata>

       

      <ui:composition>

          <h:form id="form">

      ...

       

              <rich:calendar value="#{entity.startAt}"  mode="ajax" dataModel="#{calendarModelStartAt}" />

              <rich:calendar value="#{entity.endAt}"  mode="ajax" dataModel="#{calendarModelEndAt}" />

       

      ...           

       

          </h:form>

      </ui:composition>

       

      --------------

      view.xhtml

      --------------

      <f:metadata>

          <f:viewParam name="id" value="#{entityBean.id}">

              <f:validateLongRange minimum="1" />

          </f:viewParam>

          <f:viewParam name="edit" value="#{_editMode}">

              <f:validateRegex pattern="(|true|false)" />

          </f:viewParam>

      </f:metadata>

       

      <ui:composition>

          <h:form id="form">

              <h:inputHidden id="id" value="#{entityBean.id}" />

              <h:inputHidden id="edit" value="#{_editMode}" />

      ...

       

              <rich:calendar value="#{entity.startAt}"  mode="ajax" dataModel="#{calendarModelStartAt}" />

              <rich:calendar value="#{entity.endAt}"  mode="ajax" dataModel="#{calendarModelEndAt}" />

       

      ...           

       

          </h:form>

      </ui:composition>