5 Replies Latest reply on Sep 16, 2008 9:29 AM by jaand96

    fire that event, rich:calendar!

      Hi,

      I'm having a problem with rich:calendar. I'd like it to rerender a outputPanel after the user has selected a new date.

      I've tried putting an action on a few different event handlers (onchanged etc) but nothing seems to work. I've also tried putting a a4j:support tag inside the calendar with no luck (don't think this should be necessary but wirth a try).

      A commandButton works so technically it should be ok...

      what am i missing?

      any help appreciated!

      <!- doesn't work -->
      <rich:calendar locale="sv" value="#{Utfall.kalender.time}" onchanged="#{Utfall.gaTillDag}" reRender="registreraPanel" datePattern="yyyyMMdd">
      </rich:calendar>
      
      <!- works -->
      <a:commandButton action="#{Utfall.gaTillDag}" reRender="registreraPanel" value="Uppdatera"/>
      
      <!-- want this to update when user selects a new date. -->
      <a:outputPanel id="registreraPanel">
       <rich:panel>
       blablalbla
       </rich:panel>
      </a:outputPanel>
      
      


        • 1. Re: fire that event, rich:calendar!

          should mention I use seam 2.0.3CR1 (richfaces 3.1.4.GA I believe)

          • 2. Re: fire that event, rich:calendar!
            ilya_shaikovsky

            You should use a4j:support with output panel specified in reRender registered on ondateselected event for an old versions (where the calendar has no time support) or for onchanged event for latest versions.

            • 3. Re: fire that event, rich:calendar!

              Thanks, I tried using the older version (below) but no luck. Does anyone have a working example they could post?

              I've googled for it but haven't found anything were the calendar change should fire an event...


               <rich:calendar locale="sv" value="#{Utfall.kalender.time}" datePattern="yyyyMMdd">
               <a:support event="ondateselected" reRender="registreraPanel"/>
               </rich:calendar>
              


              • 4. Re: fire that event, rich:calendar!
                ilya_shaikovsky

                ok. please add phaseTracker to your libs and check the server log for the request. Also make sure you using proper event onchanged for newest versions.

                I've just doublechecked and its works for me under 3.2.2 GA

                 <rich:calendar value="#{calendarBean.selectedDate}"
                 locale="#{calendarBean.locale}"
                 popup="#{calendarBean.popup}"
                 datePattern="#{calendarBean.pattern}"
                 showApplyButton="#{calendarBean.showApply}" cellWidth="24px" cellHeight="22px" style="width:200px">
                 <a4j:support event="onchanged" reRender="out"></a4j:support>
                 </rich:calendar>
                 <h:outputText id="out" value="#{calendarBean.selectedDate}"/>
                
                


                • 5. Re: fire that event, rich:calendar!

                  Thanks, after upgrading to 3.2.2 GA it worked straight away.