10 Replies Latest reply: Jul 23, 2013 4:28 AM by vdsadhi RSS

    Regions should display on the same position using time delay

    vdsadhi

      Hi All

       

      I am using APEX 4.0.2

       

      I have a page with 2 reports and 3 chart regions. Two reports are placed left side on the page. The charts should display one by one parallel to the reports (right side) on the page. Is there anyway to show the charts one by one using some time delay??? Is it possible to do like this in APEX???

       

      Please help me on this..

       

       

      Thanks

      Lakshmi

        • 1. Re: Regions should display on the same position using time delay
          Jezzer

          Lakshmi,

          I am guessing that you could use some JavaScript, maybe inside dynamic actions to do this for you, using javascript to do the timing bit for you. But not something I have actually wanted to do.

          Jez

          • 2. Re: Regions should display on the same position using time delay
            vdsadhi

            Thanks for your reply Jez..

             

            Please suggest me the code how can I write and where i have to use in the page...I dunno what javascript function i have to use for this...

             

            Can anyone help me on this????

             

             

            Thanks

            Lakshmi

            • 3. Re: Regions should display on the same position using time delay
              Jezzer

              I did it by setting a static id on the region I wanted to delay, then created a dynamic action which did the following on page load.

               

              1. Hide the region that I wanted to delay

               

              2. Execute the following javascript:

               

                   setTimeout(function(){$("#test2").show();},3000);

               

                  This just says to show the region, with the id test2 after a wait of 3000ms, i.e. 3 seconds.

               

                   $("#test2") is just a bit of jQuery to select the region with the id, test2.

               

              Hope this helps.

              • 4. Re: Regions should display on the same position using time delay
                vdsadhi

                I am having 3 chart regions with static id chart1,chart2 and chart3. All the 3 regions are in same position and same sequence (displaying one by one on the page). I tried to hide the 1st chart and display it after 3 seconds. It's working as you said. but when i hide the first region  the chart 2 region should display on the 1st region's position. I mean the chart regions should display one by one with time delay on the same position.  Is it possible?? Plz let me know if you can't understand my requirement.

                 

                Plz check the application http://apex.oracle.com/pls/apex/f?p=23041:1:17534982723437

                 

                can anyone plz help me on this..


                Thanks

                Lakshmi

                • 5. Re: Regions should display on the same position using time delay
                  ascheffer

                  Create an empty html region on the place where you want your charts.

                  In your DA hide all three charts, and copy the charts to the empty region when you want to show them.

                  • 6. Re: Regions should display on the same position using time delay
                    vdsadhi

                    Thanks for your reply.

                     

                    After Jezzer's reply, I was thinking about the way and tried to do that way. When I come to check the forum, you are replied the same way... but I am not sure is this the way you are mentioned.

                     

                    what I did is, I created a html region, make that region as parent region for all 3 chart regions.

                    I created DA like the below,

                    Event: Page Load

                    Action: Execute Javascript Code

                    Code:

                    $("#chart_two").hide();

                    $("#chart_three").hide();

                    setTimeout(function(){$("#chart_one").fadeOut(3000);},6000);

                    setTimeout(function(){$("#chart_two").show();},8000);

                    setTimeout(function(){$("#chart_two").fadeOut(8000);},12000);

                    setTimeout(function(){$("#chart_three").show();},20000);

                    setTimeout(function(){$("#chart_three").fadeOut(12000);},22000);

                    Its working as i expected but only on page load. Now i want to execute this javascript continuously. I tried to refresh the page using JQuery and created one more DA with After Refresh and tried some other ways.but it's not working. If I do the refresh using DA by adding one more true action on the DA, Its started refreshing the page continuously before chart loads so i am not able to see the charts.

                     

                    Can anyone tell me the better way to do this and how I can call this javascript code continuously without page reload. Suggest me any other function instead of fadeOut.

                     

                    check it in my application, just have a look http://apex.oracle.com/pls/apex/f?p=23041:2:11910527841883:::::

                     

                    Thanks

                    Lakshmi

                    • 7. Re: Regions should display on the same position using time delay
                      ascheffer

                      try this in your DA

                      function x(p)
                      {
                        $("#" + p).show();
                        setTimeout( function(){ $("#" + p).fadeOut( 3000
                                                                  , function()
                                                                    { switch( p )
                                                                      { case "chart_one":
                                                                        { x("chart_two");
                                                                          break;
                                                                        }
                                                                        case "chart_two":
                                                                        { x("chart_three");
                                                                          break;
                                                                        }
                                                                        case "chart_three":
                                                                        { x("chart_one");
                                                                          break;
                                                                        }
                                                                      }
                                                                    }
                                                                   );
                                              }
                                  , 6000
                                  );
                      }
                      $("#chart_one").hide();
                      $("#chart_two").hide();
                      $("#chart_three").hide();
                      x("chart_one");
                      
                      • 8. Re: Regions should display on the same position using time delay
                        vdsadhi

                        It's working fine but my first chart (chart_one) is displayed at 1st time after that chart_two and chart_three only showing one after another. code is looking perfect what would be the reason for this (chart_one is displayed only one time)..

                         

                        Thanks

                        Lakshmi

                        • 9. Re: Regions should display on the same position using time delay
                          ascheffer


                          I see at http://apex.oracle.com/pls/apex/f?p=23041:2:11910527841883::::: all three charts displaying one after anothers. Browser incompatabilty problems?

                          • 10. Re: Regions should display on the same position using time delay
                            vdsadhi

                            yes, I used google crome. In IE it's working fine...

                             

                            Thanks lot ascheffer..