9 Replies Latest reply: Apr 9, 2014 3:22 PM by Satish_Bathala RSS

    blocking confirmation dialog when navigating away from pop-up

    Christa van Mierlo

      Hi,

       

      In Spaces, we have a pop-up that displays the search results of a custom component that enables users to search for employees. We would like to navigate from the name of the found employee to his/her profile page. I've implemented a go-link, which is working, but when navigating away from the pop-up I get a dialog on the top of the page asking the user to confirm that he is navigating away from the pop-up since it's going to be closed after this action. We want to block this confirmation dialog. Any ideas on how to do this?

       

      Thank you for your help,

       

      Christa

        • 1. Re: blocking confirmation dialog when navigating away from pop-up
          Satish_Bathala

          Hi Christa ,

           

          Option 1 )

          I Suppose its the uncommited data warning . If yes just go the the MDS Path of that page and add uncommiteddatawarning = off to the AF:DOcument .

          It would not throw you any popup for that page.

           

          Option 2 ) If the search for employees is your custom taskflow  then go to behaviour section and uncheck critical checkbox if checked.

           


          • 2. Re: blocking confirmation dialog when navigating away from pop-up
            Christa van Mierlo

            Hey Satish,

             

            I've tried your suggestions. I've added an uncommiteddatawarning = "off" to the af:document tag of the page but still get the warning when navigating away from the pop-up. I also checked the behaviour section of the custom taskflow in jdev, but the critical checkbox was set on false by default. So no luck there.

             

            Christa

            • 3. Re: blocking confirmation dialog when navigating away from pop-up
              Satish_Bathala

              Hi Christa,

               

              1)Let me know the warning message ?

               

              2) And i Suppose you exported MDS of your Spaces page.

               

              Eg : If the page is Page11.jspx, You have exported it and added the folowing in the af:document.

                <af:document id="d1" uncommittedDataWarning="off">

              and imported the page back into spaces.

              You can do it to any page in which you dont want the warning.

               

              In That case you would never get the dirty read pop up :-)

              • 4. Re: blocking confirmation dialog when navigating away from pop-up
                Christa van Mierlo

                Hi Satish,

                 

                The error message:

                "Are you sure you want to navigate away from this page?

                There are one or more dependent dialogs open. Navigation from this

                page will invalidate any open dialogs.

                Press OK to continue, or Cancel to stay on the current page."

                 

                The top sentence and bottom sentence are in Dutch (I'm located in Holland) for some reason. The middle part is in English. I get the message in IE, Firefox and Chrome when I navigate away from the pop-up. When I click on an almost identical link in the parent page I don't get the message (it then navigates to my own profile page without any notifications).


                I've added the exact code that you described to the af:document tag of the parent page of the pop-up in jdev, redeployed the application to an adf jar, added this jar to a shared library application for custom components (project properties>Libraries and Classpaths) and redeployed this shared library to the same server that the Spaces application is running on, targetting it to it's cluster. The Spaces's extension library has a reference to the shared library in its weblogic.xml so that we can use the custom-made beans and tasksflows in Spaces by adding them to a resource catalog.


                I did some googling - the dirty read pop-up seems to trigger an onbeforeload handler that generates the message. Any idea in which file of the application this handler is located and how to stop it generating the message for this one page?


                Thanks for your help!

                Christa

                • 5. Re: blocking confirmation dialog when navigating away from pop-up
                  Satish_Bathala

                  Hi Christa,

                   

                  To Solve this issue, you should not add the code in the page of your component it should be on the spaces page.

                   

                  Eg: You have dragged and dropped your component on some page that is created in Spaces at runtime.

                  Lets say the page is Page11.jspx (You could see the page name in the URL)

                   

                  Step 1 -> Export MDS  and locate the page, path will ususally look like this if you have created a page in HOME SPACE

                  /oracle/webcenter/page/scopedMD/s8bba98ff_4cbb_40b8_beee_296c916a23ed/

                   

                  Step 2 -> Go to the page you want to add this component and add the above code.

                   

                  Step 3-> Import it back to MDS and check your functionality now.

                  • 6. Re: blocking confirmation dialog when navigating away from pop-up
                    Daniel Merchán

                    Just to add information to Satish response.


                    If you're in the 11.1.1.8 version you can edit the Page / Page Definition from the Portal Builder directly making easier changing them from MDS.

                     

                    Regards.

                    • 7. Re: blocking confirmation dialog when navigating away from pop-up
                      Christa van Mierlo

                      Hey Satish,

                       

                      Sorry for my late reply. That creates a problem though. We would like business users to be able to add this functionality to their own space. Is there a way to incorporate the uncommiteddatawarning="off" attribute in a template so that business users don't have to export the MDS, change the code and import it back again? <af:document> cannot be called inside a <af:template> tag, can it?

                       

                      Also, we don't understand why we get this warning. The search functionality is dropped as a fragment on a page in Spaces or in the custom portal. When the user enters data and pushes the search button, a method is triggered that opens a connection to an LDAP, searches the LDAP for employees matching the filters in the request, reads in the results into an array, and then closes the connection. The data in this array is used for the subsequent popup. The filters in the pop-up also use this array when refining the results further, they do not search the LDAP. There is, however, a dialog open (the pop-up has the dialog attribute on true) that should trigger different handlers for the one-choicebox filters and the close button. But there should not be any operations on the database. Only on the array. So why is it giving an uncommited data warning? We don't see the warning when we allow the link to open the profile page of the selected employee in the pop-up itself. Or when we allow the link to be opened in a new window. So it seems to be related to the closing of the pop-up.

                       

                      Again thanks for all your help!

                       

                      Christa

                      • 8. Re: blocking confirmation dialog when navigating away from pop-up
                        Christa van Mierlo

                        Hi Daniel,

                         

                        We are using 11.1.1.6 unfortunately. I tried the Portal Builder but I can only change the source code of templates, skins, navigation etc. There will be an upgrade to 11.1.1.8 soon, but still we don't want business users to mess around in source code.

                         

                        thanks for the tip though!

                         

                        Christa

                        • 9. Re: blocking confirmation dialog when navigating away from pop-up
                          Satish_Bathala

                          Hi Christa,

                           

                          1) The data warning appears if any one of the taskflow is critical on the page, So do check other taskflows too.

                          2) If it still continues to show up, Then i would say do a server redirect

                          Replace goLink with a commandLink with partailsubmit set to true, pass the user's id with setPropertyListener

                          and do a server redirect using requestdispatcher to the other user's profile.

                           

                          The second option would be some extra work :-)