2 Replies Latest reply on Oct 9, 2007 6:05 AM by ronanker

    rich:calendar performance

    ronanker

      hello,

      thanks for the new component rich:calendar, it's very good.

      I don't understand exactly how the dates in the calendar are generated, but it seems that in client mode it's javascript and in ajax mode it asks the server... but i'm not sure...
      for best performance I would like to have the calendar in client mode but submit changes by ajax... because having an ajax request at each month change is very slow... just submit ajax on selection of a date.
      reading other posts it seems that some weird combinason with a4j support can make it but i don't understand it...
      the comportment i describe should be a standard, i think...

      also, i would have like to have a 'inputSize' attribute to define the size of the input. instead of it i defined a new css class to define a width...
      a maxInputSize with the size of the date pattern can also be a good idea.

      See what you can do for future releases.

      and thanks again for your work !

        • 1. Re: rich:calendar performance
          ronanker

          well,

          i understand better now... it's just not supposed to act like i thought it would...
          the mode doesn't apply for the value, but only for the component...
          let's add a4j:support for ondateselected and oninputchange
          or add listeners for theses events (in calendar's properties).

          So it's just OK but lacks of documentation and exemples...
          here is my test code :

          <h:panelGroup id="components">
           <a4j:region id="dat1">
           <rich:calendar value="#{handler_test.valeurs1.dateTest}"
           locale="#{contexte.beanContexte.beanContexteLangue.locale}"
           popup="true"
           datePattern="#{contexte.beanContexte.beanContexteLangue.formatDate}"
           enableManualInput="true"
           mode="client"
           inputClass="input colonne_date"
           buttonIcon="/images/ico_calendrier.gif"
           >
           <a4j:support event="ondateselected" reRender="repeater"/>
           <a4j:support event="oninputchange" reRender="repeater"/>
           </rich:calendar>
           <a4j:status startText=" MàJ" stopText=" OK" for="dat1" />
           </a4j:region>
           <%-- ... --%>
          </h:panelGroup>
          <h:panelGroup id="repeater">
           <h:outputText value="#{handler_test.valeurs1.dateTest}">
           <f:convertDateTime pattern="#{contexte.beanContexte.beanContexteLangue.formatDate}" />
           </h:outputText>
           <%-- ... --%>
          </h:panelGroup>




          • 2. Re: rich:calendar performance
            ronanker

            just for documentation, tomahawk equivalent version :

            <t:inputCalendar value="#{handler_test.valeurs2.dateTest}"
             renderAsPopup="true"
             renderPopupButtonAsImage="true"
             popupButtonImageUrl="/images/ico_calendrier.gif"
             size="#{constantes.SIZE_INPUT_CMS_DATE}"
             styleClass="input"
             >
             <f:convertDateTime pattern="#{contexte.beanContexte.beanContexteLangue.formatDate}" />
             <a4j:support event="onchange" reRender="repeater"/>
            </t:inputCalendar>

            but in current versions the RichFaces one is better.