7 Replies Latest reply on Aug 26, 2010 1:25 AM by Eswaramoorthy S

    How to copy one rich:calendar value to another rich:calendar

    Eswaramoorthy S Newbie

      How to copy one rich:calendar value to another rich:calendar field ....


      Please help me....


      Thanks
      Eswar




        • 1. Re: How to copy one rich:calendar value to another rich:calendar
          Eswaramoorthy S Newbie

          Eswaramoorthy S wrote on Aug 20, 2010 08:56:


          How to copy one rich:calendar value to another rich:calendar field ....

          Please help me....

          Thanks
          Eswar






          Click HELP for text formatting instructions. Then edit this text and check the preview.

          • 2. Re: How to copy one rich:calendar value to another rich:calendar
            Leo van den berg Master

            Hi Eswar,


            I see that you're repeating your question, but - to be honest - it is a bit unclear and for sure NOT for this forum.


            (1) do you want to copy bean-values may: Get the value in the getValue in the first component, put it in the second with setValue and rerender the part of the screen when you want to visualise it.


            (2) You can cut-and-paste values from one component to another if that is what youe mean.


            Leo

            • 3. Re: How to copy one rich:calendar value to another rich:calendar
              Eswaramoorthy S Newbie
              Hi Leo van den Berg
                   
              Thanks for your reply,
              And I have been assigned single rich:calendar value to two different getter and setter method.
              Means i stored a single rich:calendar value at two columns in a single table.     

              But i want, If user select one rich:calendar value then the same value automatically reflect to another rich:calendar when user moves out from first rich:calendar.


              And I'm using <ui:composition> so java script not usable.

              I hope now you are clear.

                Please don't forget to quote!
              • 4. Re: How to copy one rich:calendar value to another rich:calendar
                Leo van den berg Master

                Hi,


                You should use ajax to do this. At the moment you get out of the box (blur), you activate the function to add the first value in the second calendar. I normally use the a4j:support tag to do this, but rich:valendar has build-in ajax-support, so possibly it can be done directly.


                Leo

                • 5. Re: How to copy one rich:calendar value to another rich:calendar
                  Eswaramoorthy S Newbie

                  Hi Leo


                     I want that function only, for how to add first calendar value to second calendar while onBlur. I use AJAX only.






                  Thanks
                  Eswar



                  Please don't forget to quote!

                  • 6. Re: How to copy one rich:calendar value to another rich:calendar
                    Rocky S Master

                    The simple solution to your problem is-


                    example-
                    1) first calendar refers to the bean value


                    value="#{bean.fromDate}"
                    



                    2) second calendar it should also refer to the same above bean value


                    value="#{bean.fromDate}"
                    



                    Now when the user enters the date for 1st calendar, use either

                    a4j:support

                    onblur event or rerender or if it supports by default should work.

                    • 7. Re: How to copy one rich:calendar value to another rich:calendar
                      Eswaramoorthy S Newbie
                      Hi Aman
                       
                        Im not asking like that

                      I use two rich:calendar in my page one is visible to user and another one is not visible to user.

                      If user select one calendar value and the same date value reflected to second rich:calendar , but the values are stored in two different columns in database table.So i use two different getter and setter methods, to store the value in database.

                      Here is my code, which works successfully
                      For this i used alternate method.

                      @Column(name = "PROCESS_DATE")
                           
                            public Date getProcessDate()
                              {
                                return processDate;
                           }

                           public void setProcessDate(Date processDate
                            ) {
                                this.processDate = processDate;
                           }
                      @Column(name = "PROCESS_DATE1")     
                           public Date getToDate()
                              {
                                toDate=processDate;
                                return toDate;
                           }

                           public void setToDate(Date toDate)
                               {
                                toDate=processDate;
                                this.toDate = toDate;
                           }

                      Here i use only one calendar , send the value to first getter and setter method
                        And assign the same value to second getter and setter method .
                      It works good...



                      But i want to do like.

                      If user select one calendar value and the same date value reflected to second rich:calendar .Then i send the two same date value to two different bean getter and setter method.




                      Thanks
                      Eswar