9 Replies Latest reply on Jan 9, 2009 2:00 PM by rtalton

    Removing browser referesh capabilities

    amthekkel Level 1
      Hi,

      I have a flex application that runs fine apart from the part that while i am using it, if i accidentally press the referesh or home button, the application reloads to the home page.. Is there a way to disable refresh and home functionality on the browser while the application is launched.
      Flex compiler options seems only to allow the disabling of back and forward button .

      Any suggestions would be much appreciated .

      thanks

      abhi
        • 1. Re: Removing browser referesh capabilities
          VPI MkIII
          The browser is under the user's control, so any attempt to "solve" the problem there will eventually backfire. You be better off just making sure your page can cope with refreshes.
          • 2. Re: Removing browser referesh capabilities
            amthekkel Level 1
            Hi VPI MKLL,

            Thanks for your reply.. I agree to the fact that generally the browser is under a users control, but is it not possible to customize and programmatically launch browsers with restricted capabilities. Flex compilier options allow launching the application without backward and forward navigation, shouldn't there be a way to stop page refersh's etc.

            cheers
            abhi
            • 3. Re: Removing browser referesh capabilities
              amthekkel Level 1
              Hi VPI MKLL,

              Thanks for your reply.. I agree to the fact that generally the browser is under a users control, but is it not possible to customize and programmatically launch browsers with restricted capabilities. Flex compilier options allow launching the application without backward and forward navigation, shouldn't there be a way to stop page refersh's etc.

              cheers
              abhi
              • 4. Re: Removing browser referesh capabilities
                VPI MkIII Level 1
                I suppose you could be really mean and remove the entire toolbar, can't remove items with something like this:

                <script>
                function onClickDo()
                {
                window.open('anotherfile.html','_blank',' titlebar=yes, location=no,resizable=yes,channelmode=no,
                directories=no, status=no, scrollbars=0');
                }
                </script>

                <body>
                <a href="javascript:;" onClick="javascript:onClickDo()">New Page</a>
                </body>

                No tooldbar, but you still can go back with the BackSpace key and you can refresh the page with the F5 key, also you still can do both via the context-menu of the page...

                so back to square one.
                • 5. Re: Removing browser referesh capabilities
                  rtalton Level 4
                  To my knowledge, Flex does not "disable" forward/backward browser navigation. I think you are actually referring to disabling the History Management feature. Anytime the user refreshs the browser, the SWF will reload. It's just the way things work and Flex has no control over it.
                  • 6. Re: Removing browser referesh capabilities
                    amthekkel Level 1
                    hi rtalton,

                    you can for testing atleast disable forward and backward navigation. To achieve this, you need to uncheck the "enable integration with browser nagigation" option. I have small blog explaining this at http://amthekkel.blogspot.com/2009/01/flex-disabling-forward-and-backward.html
                    Only problem is that it only works if you compile and run the application from flex builder. if you try accessing the url directly from a browser it doesn't work.. so unless there is a way to make this change permanent the whole concept seems a bit useless.
                    • 7. Re: Removing browser referesh capabilities
                      rtalton Level 4
                      Hi,
                      The option you are referring to is used for the Deep Linking functionality. It is NOT a switch to disable forward/backward buttons on the browser. See the help docs for details about Deep Linking.

                      What you can do is disable History Management for the application. History Management is enabled by default for a Flex application. Then the forward/back buttons will not be affect navigation within a Flex application. But again, this has nothing to do with navigating from a web page to a Flex application. In this case, the back button, at the very least, will always be available so the user can go back to her original page.

                      Instead of approaching browser control from within Flex, I think you should look to javascript code within the html wrapper to accomplish what you want. Flex is the wrong place to look.
                      • 8. Re: Removing browser referesh capabilities
                        Level 7

                        "rtalton" <webforumsuser@macromedia.com> wrote in message
                        news:gk7qj3$cpm$1@forums.macromedia.com...
                        > Hi,
                        > The option you are referring to is used for the Deep Linking
                        > functionality. It
                        > is NOT a switch to disable forward/backward buttons on the browser. See
                        > the
                        > help docs for details about Deep Linking.

                        Just a further clarification for what he's saying...the reason these buttons
                        are disabled is because when Flex builder opens the window, there's no
                        history to navigate forward or backward into. When deep linking is
                        disabled, none develops as you navigate through your app. You can enable
                        the back and forward buttons by typing a url into the address bar and
                        clicking "go".


                        • 9. Re: Removing browser referesh capabilities
                          rtalton Level 4
                          Yeah, what she said!!