1 2 Previous Next 15 Replies Latest reply on Feb 11, 2019 8:15 AM by fac586

    Identify the page calling the modal page

    Laury

      Hi,

       

      I am working with APEX 51.

      I have a nomal page, page=10 that call a modal page, page=20.

      I have also another pagem page=3 that also call page=20.

      I want to add a button for a process on page=20, but only if the modal page is called from page=3.

      For page=2, the button should not appear.

      Does someone know how to achieve this result?

       

      Kind Regards.

        • 1. Re: Identify the page calling the modal page
          John Snyders-Oracle

          Hi,

          A dialog should not know from where it was called. It can however have a range of different behaviors. For example a dialog could be used to edit or create an employee record. You just need to pass into the dialog (via a page item on the URL most likely) an indication of which way it should behave.

          Having a page item such as P20_SOURCE_PAGE is not very semantic. But if your conditional button process is for deleting then you might have P20_ALLOW_DELETE and from one page you pass in 'Y' and the others 'N'.

          Regards,
          -John

          1 person found this helpful
          • 2. Re: Identify the page calling the modal page
            fac586

            Laury wrote:

             

            I am working with APEX 51.

            I have a nomal page, page=10 that call a modal page, page=20.

            I have also another pagem page=3 that also call page=20.

            I want to add a button for a process on page=20, but only if the modal page is called from page=3.

            For page=2, the button should not appear.

            Does someone know how to achieve this result?

            Set specific REQUEST values in the target attributes/URLs used to open the modal page to indicate which "mode" it is in. Use a Request = Value server-side condition to control rendering of the button. Ensure that the process is also conditional, depending on that button being clicked.

             

            Using the REQUEST value during page show processing in this way is much less common than using it in the page accept phase, but it is a useful technique that eliminates the need to create additional page items for use as flags. Note however that the initial REQUEST value will only be available during page rendering.

            1 person found this helpful
            • 3. Re: Identify the page calling the modal page
              Laury

              Hi John,

               

              So, you mean that I should create P20_ALLOW_DELETE (on the modal page), and assign it for instance a value of Y if I want to perform a deletaion, triggered from page=3, correct?

               

              Kind Regards

              • 4. Re: Identify the page calling the modal page
                Laury

                Hi fac586,

                 

                REQUEST is in fact an APEX variable, I can for instance set it with the value of Y when I trigger the call of the Modal Pop-Up.

                The Pop-Up sees the vaue of Y, and that is the condition I use to display the button on that Pop-Up.

                After I have pressed that button, how can I reset the value of REQUEST?

                 

                Kind Regards

                • 5. Re: Identify the page calling the modal page
                  fac586

                  Laury wrote:

                   

                  REQUEST is in fact an APEX variable, I can for instance set it with the value of Y when I trigger the call of the Modal Pop-Up.

                  The Pop-Up sees the vaue of Y, and that is the condition I use to display the button on that Pop-Up.

                  After I have pressed that button, how can I reset the value of REQUEST?

                  You just have. As described in the documentation:

                  Each application button sets the value of REQUEST to the name of the button or to the request value attribute associated with the button, enabling accept processing to reference the name of the button when a user clicks it.

                  When the pop-up page is submitted, the REQUEST value is the name of the button used to submit it.

                  1 person found this helpful
                  • 6. Re: Identify the page calling the modal page
                    Laury

                    Hi,

                     

                    Thanks, I will try it, and come back here.

                     

                    Kind Regards

                    • 7. Re: Identify the page calling the modal page
                      Laury

                      Hi,

                       

                      I still do not understand the user of the built-in REQUEST.

                      Page=2 is my main page, when I press button X, it pops-up page=7.

                       

                      On page=2, I have an after submit process, when button X is pressed:

                       

                      begin

                          :P7_REQUEST_APEX := :REQUEST;

                      end;

                       

                      But when I press that button, the page pops-up, the item P7_REQUEST_APEX is still empty.

                      I uderstood that the built-in REQUEST should get the name of the X button.

                      What is then wrong?

                       

                      Kiind Regards

                      • 8. Re: Identify the page calling the modal page
                        Franck N

                        Hi,

                         

                        here is my input to the whole sutuation.

                         

                        step 1: havve an item hidden on page 20 let´s call P20_CALLER.

                         

                        in case you are using the link builder to navigate to page 20  from page 10 or 3 then set the value accordingly into the item.

                         

                        With this step each time you navigate to the page 20, the Item will recieve the Value from the parent page.

                         

                        now have your Button as you discribed it with the functions attached to it.

                        on that button add a server side condition to display the Button only if you are coming from page 3 which means when the Item P20_CALLER as the Value 3.

                         

                        result the Button will only be visible when coming from page 3.

                         

                        this should do the trick.

                         

                         

                        regards,

                        Franck

                        1 person found this helpful
                        • 9. Re: Identify the page calling the modal page
                          fac586

                          Laury wrote:

                           

                          I still do not understand the user of the built-in REQUEST.

                          Page=2 is my main page, when I press button X, it pops-up page=7.

                          How? What action is defined for button "X"?

                          On page=2, I have an after submit process, when button X is pressed:

                           

                          begin

                          :P7_REQUEST_APEX := :REQUEST;

                          end;

                          Why? The whole point of using REQUEST here is to avoid the need for an additional item in the target page.

                          • 10. Re: Identify the page calling the modal page
                            Laury

                            Hi,

                             

                            @fac586:

                            Button X just call the pop-up page page=7

                            So, how to read (get) the value of REQUEST when that specific button is pressed without using an intermediate item?

                             

                            @Frank:

                            I will come back to your post.

                             

                            Kind Regards

                            • 11. Re: Identify the page calling the modal page
                              fac586

                              Laury wrote:

                               

                              @fac586:

                              Button X just call the pop-up page page=7

                              How? What action is defined for the button?

                              • 12. Re: Identify the page calling the modal page
                                Laury

                                Hi,

                                 

                                Here are the properties of the button:

                                 

                                Action When Button Clicked -> Action: Redirect to Page in this Application => Page=7, Clear Cache=7

                                 

                                So, how to read (get) the value of REQUEST?

                                • 13. Re: Identify the page calling the modal page
                                  Laury

                                  Hi,

                                   

                                  I have found how to use thelt-in REQUEST.

                                  It does not need to be the name of the button.

                                  I just need to have on the colling page, for me page=2:

                                  Action When Button Clicked -> Request: CREATE

                                  Then, on the called page, for me page=7, I just need to have a condition for REQUEST for any element, an item or a button.

                                  In my situation, I want to display a button for further processing. So, I have for that button:

                                  Conditions -> Condition Type: PL/SQL Expression -> Expresion1: :REQUEST = 'CREATE' (the value I gave above).

                                   

                                  Kind Regards

                                  1 person found this helpful
                                  • 14. Re: Identify the page calling the modal page
                                    Laury

                                    @Frank N:

                                     

                                    Your solution is also interesting.

                                    But I prefer the one that uses the REQUEST built-in variable.

                                    So, I didn't test your solution.

                                     

                                    Kind Regards

                                    1 2 Previous Next