7 Replies Latest reply on Mar 1, 2017 10:16 AM by Pavel_p

    APEX 5.1 - Focus Page annoying message

    Pavel_p

      Hello,

      in APEX 5.1, there seem to be a check if the page data had changed before leaving the page and warning which makes working with it extremely annoying and time consuming. Whenever I change page data in the page designer (change the procedure code or whatever), instead of simply running the page I'm getting the following message (in all browsers):

      focus_page.jpg

      Try Again sometimes works, sometimes not. On the target page there is a warning

      leave_page.jpg

      I'm not sure if my description is clear, so I created a simple testcase on apex.oracle.com

      workspace: testing

      user: test

      pwd: test

      Application 42783 - cannot_focus_page

      Steps to reproduce:

      On Page 1 there is a Set Value DA bound to the P1_NEW item. It's a simple PL/SQL expression that sets value of  P1_NEW_1 with PL/SQL epression :P1_NEW + 10.

      Run the page => Quick Edit the P1_NEW item and modify the expression to anything else (for instance to :P1_NEW + 1) and run the page again.

      Instead of switching to the page the IDE stays in the Page Designer and the Focus Page modal window pops up.

      Please, is there any way how to disable this? With this feature is working with APEX really painful.

      Thanks a lot,

      Pavel

        • 1. Re: APEX 5.1 - Focus Page annoying message
          John Snyders-Oracle

          Hi Pavel,

          This is expected behavior. When you Save and Run the page from page designer what is happening is that the page is being refreshed just as if the user had pressed F5. The message is a consequence of the new APEX feature to warn if there are unsaved changes on the page. The behavior should be no different for the end user using the page or page designer automatically reloading or changing the page.

           

          You can disable the APEX feature with the page attribute Navigation: Warn on Unsaved Changes. Set it to No. Or if, as in your test case, you have a field that is dynamically updated you may want to just exclude that one field from checking if it has changed. Each Item has attribute Advanced: Warn on Unsaved Changes that you can set to Ignore.

           

          Regards,

          -John

           

          1 person found this helpful
          • 2. Re: APEX 5.1 - Focus Page annoying message
            Pavel_p

            Hi John,

            thank you for your response and explanation. In fact it's not that tough to figure out what can possibly be happening under the hood and why I was getting these messages, I just wanted to point out that this implementation is quite unlucky and in some circumstances can become a real pain. I cannot agree that the behavior should be no different for the end user and running the page from the page designer (or better to say trying to run the page). While in the former case it's perfectly reasonable to warn the user that he's going to leave the page and lose changes (and thank you very much for implementing this long-awaited feature - highly appreciated), the latter case is completely different. In this case the developer makes intentionally some changes and all he wants at the moment is to run the page and see the changes he made. But instead of running the page the Page Designer stubbornly keeps popping up the "Focus Page" message with another popup on the target page, so in some situations you end up with clicking "Try Again" and "Leave the Page" buttons over and over again, which is...well, really frustrating. Let's suppose most of APEX developers are reasonably sane and they are perfectly aware of the fact that if they change the underlying PL/SQL procedure, it will also change the data on the target page - finally that is the purpose.

            I understand that it would probably need a lot of additional logic to implement some "smart" notifications, but the ability to simply turn off these notifications at an IDE level would be great. It has nothing in common with the application logic, options you named would influence the application which is not desirable as I would like to keep notifications in the final app. All I'm missing is a simple way not to be notified all the time about something I'm perfectly aware of - one ON/OFF button in the IDE toolbar that would disable these checks during development.

            Please, try to create few forms with some dynamic actions and you'll see how productive it is to fight all the time with the "Focus Page" popup message.

            Best regards,

            Pavel

            • 3. Re: APEX 5.1 - Focus Page annoying message
              Pavel_p

              Hello again,

              after seeing the message countless times in all kinds of different circumstances (even the basic edit icon change in the report results with it), I consider it as a serious APEX 5.1 usability issue. So far I've been "toying" with APEX 5.1, no real production app, just a hobby project for my friend and I'm already desperate with seeing this message over and over again. After up to 30 hours working with APEX 5.1 I would give anything for a button that would disable these checks as I proposed in my previous post.

              joelkallman-Oracle, Patrick Wolf-Oracle, I'm begging you, please could you consider giving us some option how to optionally disable this behaviour at an IDE level, so we would not be getting this message all the time during development?

              Best regards,

              Pavel

              • 4. Re: APEX 5.1 - Focus Page annoying message
                Patrick Wolf-Oracle

                Hi Pavel,

                 

                I do understand that the 'Focus Page' can get really annoying, and it's annoying for us as well. This comes down to how the different browsers implement browser security to avoid that web pages automatically open popups/other tabs and put focus to that 'advertising' page. A browser allows to put focus to another tab as long as this event is directly triggered by an end user. But as it's in our case, if the user action triggers an Ajax call to save changes and only in the case of a successful response triggers the focus changed, this is handled by some browsers as potential spamming because it's not directly triggered by the end user.

                 

                Personally I always use the separate 'Save' and then the 'Run' button to avoid this kind of issue, because in this case the 'Run' button click will be a user triggered operation and tab focus works without any issues. But I do agree that at least we should add a 'Do not show again' message to the 'Focus Dialog' to not show the dialog for advanced developers. I will file a bug for this.

                 

                About the 'Warn on unsaved changes' dialog which also gets displayed if a page gets refreshed by Page Designer. Will have to check with John if Page Designer can 'tell' the page to ignore the check. Could be tricky, because security wise both tabs are isolated and the 'Warn on unsaved changes' is implemented as an onunload event.

                 

                Regards

                Patrick

                • 5. Re: APEX 5.1 - Focus Page annoying message
                  Pavel_p

                  Hi Patrick,

                  thank you sooo very much for your explanation and the tip how to make development more user friendly. With your hint to hit Save => Run it is possible get to acceptable level of Focus Page messages. I got used to the Page Designer in 5.0 and (if I'm not mistaken) it was basically the same to just Run the page and Save the page first and then Run it, so I had absolutely no idea it could suddenly make any difference. Some checkbox would be more than welcome though (Run=>Try Again are still two clicks - the same as Save => Run even if the latter method seems to be a bit faster).

                  I understand that to deal with Warn on unsaved changes after the page is generated could be more difficult, in fact for me it's a complete mystery how the Page Designer "talks" with the generated page and vice versa. So what I'm proposing is to have the ability to turn it off completely, so no onUnload event code would be generated if the page is run from within the Page Designer with this feature turned off. Unfortunately I'm not sure how difficult it would be but I really hope the dev team will find some way how to implement it.

                  Anyway, thanks lot to the entire development team that you do care of what your users say. It's really refreshing and encouraging to get feedback from the IDE development team. I really appreciate it (and probably not only me) because there were times when I used to work with tools whose developers thoroughly kept the "silence is golden" approach.

                  Regards,

                  Pavel

                  • 6. Re: APEX 5.1 - Focus Page annoying message
                    John Snyders-Oracle

                    Hi Pavel,

                     

                    Patrick is correct about the complex browser specific issues around the new in 5.0 feature of managing the app window. I have observed that many Chrome users have gotten in the habit of pressing Save and then Save and Run. I use Firefox mostly and personally prefer the app to open in a new window so the only time I get the Focus Dialog is when there truly is a problem loading/focusing the page.

                     

                    I believe your main concern is with the intersection of the PD Save and Run button with the new in 5.1 warn on unsaved changes feature. (By the way the same problem would happen if you were using a 3rd party plugin to accomplish the warn on unsaved changes behavior in 5.0.) This has affected all of us. I run in to it because I do lots of development and testing of interactive grid.  My concern with turning it off completely is that It is possible that someone is using an app from the builder and at the same time doing meaningful work for which they would not want to loose changes.

                     

                    The question of is it possible to disable the check for changes from the builder window is interesting to me. I did some investigation and came up with this. If you enter this in the JavaScript console of the page designer:

                     

                    $("#button-save-run-page").click(function() { window.open("", apex.builder.getAppUnderTestWindowName($v("P4500_CURRENT_APP") + "_" + $v( "pInstance" ))).apex.page.cancelWarnOnUnsavedChanges() });

                     

                    Then you will not get a warning even if the page has changes when you press the Save and Run button. This would need to be done each time page designer page loaded. You could try to turn that into a bookmarklet to make it easier to do each time you go into page designer.

                     

                    We could look into making this an option in the future. As I already said I don't think this should be done unconditionally. I think the default should be to do the check because loosing data when you don't expect to is more concerning.

                     

                    The cancelWarnOnUnsavedChanges function is documented and you may find other uses for it to turn off the feature perhaps somehow combined with a build option.

                     

                    Regards,
                    -John

                    1 person found this helpful
                    • 7. Re: APEX 5.1 - Focus Page annoying message
                      Pavel_p

                      Hi John,

                      thank you very much for further explanation and interesting tips and sorry for a bit late response - it took me some time to think about what you wrote and test it.

                      I probably don't fully understand what you're saying about FF and Chrome differences and user habits - I use FF as well and yesterday installed Chrome (I don't like it because of several good reasons) but the only difference in FF and Chrome behavior in this matter is that FF opens the page in a new window, which is my personal preference as well, while Chrome opens it in a new tab. Otherwise I'm getting the Focus Page in exactly same situations, so no real difference between these two browsers.

                      You are right that with the proposed ability to turn warnings (optionally) off it would be possible to lose some meaningful work. In my opinion it's completely wrong to develop "on the fly" while other users are doing something meaningful. The sooner they lose some data, the better for them, it's for their own sake to change the procedure and have (at least) separated development and production environment. If there is someone who develops on the same environment while other users use the app, they simply deserve to lose their data.

                      I also tried your proposed workaround how to disable warnings. Unfortunately it does not work exactly how I intended - the target page is being showed immediately and is refreshed after few moments, but when I get back to the Page Designer, there is the FP message waiting for me, so in fact it does not matter if I get it right after Save and Run or later.

                      I also completely agree with you that whatever implementation you choose, it should be optional (it's always nice to have options), not just because of unexpected possible data loss (however in all previous APEX versions this would happen anyway) but also because sometimes developers would like to test the page's real behavior. But in most cases during development it's not desirable (ofc only my personal opinion after few days).

                      Have a nice day,

                      Pavel