14 Ответы Последний ответ: 07.12.2018 15:48, автор: Joe R

    Refresh the Calling Page after Download 5.1.2.00.09

    Joe R

      Version: 5.1.2.00.09

       

      Hello,

       

      This is an addition to https://community.oracle.com/thread/4187665

      After the file is downloaded, I'd like to refresh the calling page. This is to hide/show Regions on the calling page.

      I've tried different Dynamic Actions, but the calling page is not Refeshed/Submitted.

       

      In the referenced post, a call is made to another page to perform logging of the data that is downloaded at that moment.

      In the process that performs the logging I'm setting hidden page items on the calling page.

       

      I was hoping to inspect those page items on the calling page to Refresh or Submit the page so Regions are hidden and other Regions are displayed, but there is no action performed after the Save As box is closed and control is back to the calling page.

       

      Can someone help me with how to Refresh or Submit the calling page after the Save As box closes?

      Please let me know if you have an idea but this isn't clear what I'd like to happen.

       

      Thanks,

      Joe

        • 1. Re: Refresh the Calling Page after Download 5.1.2.00.09
          Franck N

          Hi,

           

          from what i read on your previous you are using a Function triggered on Button-click  to Download your Files.

          before i could make any suggestion,

          I would like to have if possible a little input about the definition of that function and how you are calling it.

           

          regards,

          Franck

          • 2. Re: Refresh the Calling Page after Download 5.1.2.00.09
            Joe R

            Franck,

             

            Thank you for replying.

             

            As fac582 suggested:

            • Copy the report region to a new page.
            • In the report attributes, change its Template Type to Predefined and the Template to CSV.
            • Add the archive process to the new page at the Before Regions processing point.
            • Create a download link or redirect button on the original page, setting the target to be the new CSV report page.

             

            So, the button on the calling page is set to redirect to a new page that contains the report that for the data to be downloaded.

            In the Before Region is a process that contains the DML to do the archiving of the data that is downloaded.

             

            By setting the templates as directed, the Save As dialogue box displays to Save the file or open it.

            So after the file is Saved and control is passed back to the calling page, I'd like the calling page to Refresh. I'm setting hidden page items to control various Regions on the page to display and not.

             

            I hope this makes sense.

             

            Thanks,

            Joe

            • 3. Re: Refresh the Calling Page after Download 5.1.2.00.09
              Franck N

              Hi,

               

               

              As fac582 suggested:

              • Copy the report region to a new page.
              • In the report attributes, change its Template Type to Predefined and the Template to CSV.
              • Add the archive process to the new page at the Before Regions processing point.
              • Create a download link or redirect button on the original page, setting the target to be the new CSV report page.

               

              So, the button on the calling page is set to redirect to a new page that contains the report that for the data to be downloaded.

              In the Before Region is a process that contains the DML to do the archiving of the data that is downloaded.

               

              By setting the templates as directed, the Save As dialogue box displays to Save the file or open it.

              So after the file is Saved and control is passed back to the calling page, I'd like the calling page to Refresh. I'm setting hidden page items to control various Regions on the page to display and not.

              is this all happening in a modal Page or normal Page?

               

              anyway try this: change the settings of the Button to submit page. then declare a Branch --->validation Point after Processing

              behavior you can do the redirect settings  as you did before. Server side condition--> when Button pressed--> your button name.

               

              If this doesn't work. I have some other Ideas in mind.

               

               

               

              regards,

              Franck

              • 4. Re: Refresh the Calling Page after Download 5.1.2.00.09
                fac586

                Franck N wrote:

                 

                anyway try this: change the settings of the Button to submit page. then declare a Branch --->validation Point after Processing

                behavior you can do the redirect settings as you did before. Server side condition--> when Button pressed--> your button name.

                 

                If this doesn't work. I have some other Ideas in mind.

                Let's hear them, because that isn't going to work.

                • 5. Re: Refresh the Calling Page after Download 5.1.2.00.09
                  Franck N

                  I am still hoping from more Input from the OP regarding my questio.

                  fac586 schrieb:

                  Let's hear them, because that isn't going to work.

                  it seems there is also a testing environment for this.

                  please feel free to share it For a better understanding of the issue here.

                  • 6. Re: Refresh the Calling Page after Download 5.1.2.00.09
                    Joe R

                    Franck,

                     

                    As fac586 indicated there is new page created, normal, that contains a Classic Report with the Template Type to Predefined and the Template to CSV.

                    fac586 can explain the details of this approach, but when the page is called the report executes and because it is defined as a CSV template the standard windows Save As dialogue is displayed.

                    This would be the same dialogue box that is displayed when the Export Link is enabled and appears at the bottom of the report. When that link is clicked the Save As dialogue box is displayed.

                     

                    This is the action that fac586's approach is doing. The reason for doing it this way is because I have to capture the exact data that is being downloaded at that moment and insert it into an archive table.

                    That functionality is not possible using the built-in download link provided.

                     

                    On the calling page I have multiple regions that display information to the user before the download and after the download. The displaying is done using hidden page items that are set during this process. I would like the calling page to Refresh/Submit AFTER the Save As box closes and control is returned to the calling page which would display or not display the regions I'm trying to control.

                     

                    It's not the calling of the new page that creates the CSV to download, but after the file is Saved or Opened.

                     

                    I hope this makes sense.

                     

                    Thanks,

                    Joe

                    • 7. Re: Refresh the Calling Page after Download 5.1.2.00.09
                      Franck N

                      Hi

                       

                       

                      Joe R wrote:

                       

                      Franck,

                       

                      As fac586 indicated there is new page created, normal, that contains a Classic Report with the Template Type to Predefined and the Template to CSV.

                      fac586 can explain the details of this approach, but when the page is called the report executes and because it is defined as a CSV template the standard windows Save As dialogue is displayed.

                      you mean "the standard Windows Save as dialogue is not getting displayed" or am i getting something wrong here. because following the Above described instructions, the Download  as CSV is happening directly on click without any Prior confirmation, dialog or anything.

                      If i am right, are you looking for a solution like this : https://apex.oracle.com/pls/apex/f?p=56890:5:::NO:::

                       

                      regards,

                      Franck

                      • 8. Re: Refresh the Calling Page after Download 5.1.2.00.09
                        Joe R

                        Franck,

                         

                        The Save As box IS DISPLAYED.

                         

                        So, on Page 44 is a button to Download the data.

                        The Button is set to Redirect to a Page in this Application. The page that it redirects to is Page 55.

                        On Page 55 is a Classic Report with the Template Type to Predefined and the Template to CSV.

                        There is also a PL/SQL process with the processing point set to Before Regions to obtain the data that is about to be downloaded and archived and it also sets hidden page items on page 44 to control the display of Regions on page 44.

                         

                        When the button on Page 44 is clicked the standard Windows Save As box is displayed with 3 options: Open the file, Save the file, Cancel.

                        When the Save As box closes after one of the actions I'd like Page 44 to Refresh or Submit I don't care which one to invoke the conditional display conditions on the Regions on Page 44.

                         

                        Right now after the Save As box closes there is no action performed on Page 44. I don't know how to invoke a Refresh or Submit on Page 44 after the Save As box closes so the conditional displays of the Regions is performed.

                         

                        Does this help?

                         

                        Thanks,

                        Joe

                        • 9. Re: Refresh the Calling Page after Download 5.1.2.00.09
                          Franck N

                          Hi,

                           

                          yes I understand your issue here I am just missing one step. Doing the above settings as you do did Doesn’t display a save box as you can see on my link for testing it downloa the files automatically as csv i must have missed one step.

                          can you reproduce it on apex online and I will try to fix the submit issue On your app. What is important for me is getting the save box to be displayed

                          • 10. Re: Refresh the Calling Page after Download 5.1.2.00.09
                            Joe R

                            Franck,

                             

                            There is an example.

                            Workspace: joer

                            Username: dev

                            Password: developer

                             

                            Application: 29981

                            Go to Page 2 and launch it.

                            There is a button "Download Data" that redirects to page 3 where there is a Classic Report with the Template Type to Predefined and the Template to CSV in the Attributes.

                            When the button is clicked a standard Windows Save As box opens.

                             

                            There are 2 StaticRegions.

                            The first Region should be displayed when the page is first opened and should be hidden when the Save As box closes.

                            The second Region should be hidden when the page is first opened and it should be displayed when the Save As box closes.

                             

                            Please let me know if you have any questions.

                             

                            Thank you for your time!

                             

                            Thanks,

                            Joe

                            • 11. Re: Refresh the Calling Page after Download 5.1.2.00.09
                              Franck N

                              Hi,

                               

                              that is why i always like when OPs post a testing environment of their APP.

                               

                              your where talking about the Browser Confirmation mask. I was thinking about the APEX confirmation mask (silly me )

                              this confirmation only appears using the Firefox or IE browser.

                               

                              Using it with the Chrome Browser, no confirmation message will be displayed and the download will happen directly.

                              This is actually my case since i am mostly working with the google chrome Browser.

                               

                              There is a limited way to my knowledge of controlling those  browsers confirmation windows within APEX.

                               

                              Nevertheless you can submit your Page regardless of the confirmation Message as i did under This test Link -URL:

                              the result, your file will be downloaded and your page will be reloaded.

                              would you like to use this solution? https://apex.oracle.com/pls/apex/f?p=56890:5:::NO::: 

                               

                              regards,

                              Franck

                              • 12. Re: Refresh the Calling Page after Download 5.1.2.00.09
                                Joe R

                                Franck,

                                 

                                The calling page Refresh or Submit is what I was looking for.

                                The page items I'm using to control what Regions need to be displayed or hidden are (currently) being set on the page 3 (page 55 in my real app I don't actually have this set up in the test app) where the report is being executed.

                                So, in my mind, the Submit needs to happen after that event (the downloading action on page 3).

                                So how do I Submit Page 2 (page 44 in my real app) after the download happens? (if that's WHEN it would happen).

                                 

                                Thanks,

                                Joe

                                • 13. Re: Refresh the Calling Page after Download 5.1.2.00.09
                                  Franck N

                                  ok,

                                   

                                  here is how i did it :

                                  test URL on your workspace app 15582. https://apex.oracle.com/pls/apex/f?p=15582:2:::NO:::

                                   

                                  i am delaying the page submit to 1.5 seconds after the the download is clicked.

                                  for that i am having 2 Buttons as you can see on the Page designer.

                                   

                                  - one that will redirect to your page CSV as you did before with the static ID "ddr" this Button can be hidden with the in-build DA on page Load or with css as i did on the Page.

                                  - and one button (set to execute a Dynamic action) that triggers that download Button and submit Submit Page 2 (page 44 in your real app) static ID "dd".

                                   

                                  code to add at both places :

                                  • DA on click on the Button with the ID "dd" and on your Page attribute Executes when Page Load.
                                  $("#dd").click(function(){
                                      //download CSV
                                      $("#ddr").click();
                                      //submitpage after download 1,5 second
                                     setTimeout(function() {
                                            // apex.submit();
                                  apex.submit({showWait:true});
                                     }, 15);
                                  });
                                  
                                  • hide Button with CSS
                                  #ddr{
                                  display:none;
                                  }
                                  

                                  regards,

                                  Franck

                                  • 14. Re: Refresh the Calling Page after Download 5.1.2.00.09
                                    Joe R

                                    Franck,

                                     

                                    Again thank you for your help it is very appreciated. Unfortunately, this approach just isn't working as expected. The Regions either hide OR the Save As box displays, not both.

                                    When I even run your example the Save As box is sporadic. I can click the Download button 1 to multiple times and no Save As box but the next click it displays. Or I click it 1 time and it displays and click it again and it doesn't display. This was in Internet Explorer by the way.

                                     

                                    So, I created a Dynamic Action to HIDE the region on the Download button click. Since the button Action would be set to the Dynamic Action I reset the Action to Redirect to a Page in this Application.

                                    So the button does the Redirect and the Save As box is displayed and the records are archived and the Regions are hidden or displayed as expected.

                                     

                                    I'll leave this open in case better ideas come up.

                                     

                                    Thanks,

                                    Joe