1 2 Previous Next 21 Replies Latest reply on Sep 28, 2007 11:50 AM by thinkblue146 Go to original post
      • 15. Re: Calendar submit()
        thinkblue146

        eminil,

        Did you get your code to work with the new snapshot...If so could you post the parts of you code that deal with the calendar frontend and the backend...I trying to do something similar to you but I running into some issues...So if you have it working could you help me out? Thank you.

        • 16. Re: Calendar submit()
          thinkblue146

          Here is a more specific explaination of what I want to do...All I want to do is have a user pick a date using the rich calendar and whatever date that they select I want it to be populated into an outputLabel...I want this done using Ajax...I have the latest snapshot for richFaces installed and this is what I have so far for my code:

          Front end:

          
          <label>Project Start Date:</label>
          <div class="inputCalendar">
           <a4j:outputPanel id="mainStartDate">
           <rich:calendar id="projectStartDate" value="#{project.projectStartDate}" valueChangeListener="#{theProjList.calendarEvent}" datePattern="MM/dd/yy" popup="true">
           <a4j:support event="ondateselect" reRender="shadowedStartDate" />
           </rich:calendar>
          
          </a4j:outputPanel>
          
          ...
          
          <label>Project Start Date:</label>
          <div class="input">
           <a4j:outputPanel id="shadowedStartDate">
           <h:outputLabel value="#{project.projectStartDate}">
           <f:convertDateTime type="date" dateStyle="short" timeStyle="short" />
           </h:outputLabel>
           </a4j:outputPanel>
          </div>
          
          


          The above is working without any errors but when I intially come to the page the projectStartDate is null so the label doesn't show anything...Then when i select a date, it show it in the calendar but not in the label...So then I select a different date at which point the label dispays the date that I pick previously and the calendar shows the one that is correct....Any Idea of what's going on? Let me know if you need more information.

          Thank you

          • 17. Re: Calendar submit()
            kryzys

            I'm struggling with the same issue for two days. While calendar shows selected date, backing bean receives previously selected one.
            My code:

            View:

            ...
            
            <a:region selfRendered="true">
             <h:form>
             <s:decorate id="dateDecorate" template="/layout/edit.xhtml">
             <ui:define name="label">Date test:</ui:define>
             <rich:calendar id="date" value="#{bean.dateTest}">
             <a:support event="ondateselect" reRender="mainTable"/>
             </rich:calendar>
             </s:decorate>
             </h:form>
            </a:region>
            
            ...
            


            Backing bean (Seam statefull bean)

            ...
            
             private Date dateTest;
            
            ...
            
             public Date getDateTest() {
             return dateTest;
             }
            
             public void setDateTest(Date dateTest) {
             this.dateTest = dateTest;
             events.raiseTransactionSuccessEvent("testEvent");
             }
            
            ...
            

            Is this a bug, or am I doing something wrong? I've just started using RichFaces, and I'm also quite new Seam user.

            Thanks

            • 18. Re: Calendar submit()
              ilya_shaikovsky

              This is solved! Sorry for the delay. ondayselect - event that triggered before the day selected. This is to make this event cancelable. And ondayselected (from 3.1.1 RC1) - is an event that triggered after the date setted. So update your libraries and use the second event to perform what you need.

              • 19. Re: Calendar submit()
                kryzys

                Thanks a lot for quick fix :)

                • 20. Re: Calendar submit()
                  thinkblue146

                  ilya,

                  Is the fix that you are talking about in the richfaces snapshot from 9/27/2007 or do I have to get the 3.1.1 RC version.

                  • 21. Re: Calendar submit()
                    thinkblue146

                    Oh I got it now it should be "ondateselected" instead of


                    This is solved! Sorry for the delay. ondayselect - event that triggered before the day selected. This is to make this event cancelable. And ondayselected (from 3.1.1 RC1) - is an event that triggered after the date setted. So update your libraries and use the second event to perform what you need.


                    Thanks ilya that helped alot.

                    1 2 Previous Next