6 Replies Latest reply on Jul 25, 2012 8:51 AM by steve_ssh

    Open URL command in IWP

    dburnham

      I have two challenges with the Open URL command in IWP:

       

      I've got a graphic in the header of the layout which is intended to have a number of "hot spots" that will redirect the browser to certain static URL's like a Facebook page, the home page of the company's web site, etc.

       

      Problem 1:

      When I make a button on the FileMaker layout and hard code the URL into the OpenURL command and assign it to the button, it works, to the extent that a new browser window opens to the correct destination page. However, I did not want the buttons to be hard-coded, I wanted instead to have the buttons point to a field in a related table, so that the database administrator could update the links with field values instead of repetetive layout work.

       

      The problem is that the OpenURL command works perfectly when executed within FIleMaker, however, within IWP, it resist the opening of the same URL. I have found this to be the case whether the command is scripted or directly assigned to the buttons.

       

      Problem 2:

      I would like to append the URL with the target="self" code so that the action occurs within the same browser window, but I don't see a way to do that within the calculated text string that I specify in the OpenURL command.

       

       

      Thanks in advance for any help with either or both of the above.

        • 1. Re: Open URL command in IWP
          Stephen Huston

          I note that the Open URL script step is only compatible with IWP when executed with NO Dialog. This means you will need to be sure that the URL being referenced is properly set and encoded as a valid URL (spaces and special characters substituted out, etc.) and then fully encoded as a URL. This might even require full http: prefixing for your browser.

           

          You should probably use a $url variable defined in the script to furnish the proper URL for this script step. Check what are you currently using as the URL encoding. Some browsers (IWP clients) may be less forgiving of URL issues that is FMP.

          • 2. Re: Open URL command in IWP
            steve_ssh

            dburnham wrote:

             

            ...

             

            Problem 2:

            I would like to append the URL with the  target="self"  code so that the action occurs within the same browser window, but I don't see a way to do that within the calculated text string that I specify in the OpenURL command.

             

             

            Hello Dburnham,

             

             

            Short answer:

             

            I don't see what I would consider a good way to have the target page open in same browser window.

             

            I'll put a longer answer below.

             

            very best,

             

            -steve

             

             

             

            Long answer:

             

            If no better way emerges and you really need this functionality, a hack does come to mind which would work for the IWP part of this -- It wouldn't be good if the layout also serves FM clients as well:

             

            - display your header graphic within a webviewer object

              - In the webviewer web address configuration, use the data:text/url, technique so that your HTML code is calculated from values stored in your FMP file (in particular, the target URLs to which you might send the user)

              - within the HTML code that you create with your calculation, define clickable areas -- I'm thinking DIV elements within Anchor elements

              - furthermore, use your calculation to insert the appropriate URLs (drawn from your FM data, i.e. a field or a variable - not hardcoded) into the proper href attributes of the Anchor tags

              - include a target attribute on the Anchor tags of '_top'.  This should take the user entirely away from their IWP page, and the target url should open in the same window

             

            Drawbacks that I see with this technique:

             

            - If you are not comfortable with HTML, you'll probably need a little help or some patience (or both) while you learn what you need to know

              - In IWP, the webviewer is rendered as an iframe object, and it may show up with an unsightly border around its edge which would be tricky to remove

              - You'd need to test this across as many browsers as you need it to work on, and you may find that certain browsers will not work with the data:text/url scheme (In particular, I'm thinking of IE 8)

              - When you send somebody away from the IWP page in this manner, you are letting them leave without ending their session.

              - Your solution loses simplicity

             

             

            Please let me know if I haven't been clear enough about this.

            • 3. Re: Open URL command in IWP
              dburnham

              Steve,

               

              I like your idea because the layout is definitely off limits to any FMP clients, it is strictly for IWP.

               

              But the coding confuses me so I wonder if the only thing I put into the web viewer is a sliced image with URL's defined by Photoshop when the slices are saved to HTML -- wouldn't that be simpler?  I mean, there is absolutely nothing in my page header except a graphic with some hot spots.

               

              Ya think?

              • 4. Re: Open URL command in IWP
                steve_ssh

                Hi,

                 

                I think I am following you, but I'm not 100% certain of that.

                 

                If I understand you correctly:

                 

                You've already got a good way to make sections of your header image clickable within the HTML that you put in the webviewer.  That's totally fine -- I probably over-specified implementation details in my post a little bit.  If you've already got a good way to render your image with clickable areas, then there is no necessity to follow my instructions about defining extra Div elements.  The key will simply be to dynamically get your URLs into your HTML, and try it out with the target attributes set to '_top' and see if it works for you.

                 

                I'll be curious to know what you think and whether it works -- please let me know.

                 

                My one (big) remaining concern is that you really do some cross-browser checking.  If this is a public facing interface, who know what kind of browser someone is going to be using, and it's good to know up front what the user experience will/won't be.

                 

                Very best,

                 

                -steve

                • 5. Re: Open URL command in IWP
                  dburnham

                  I'll be giving  the web viewer idea a tryout today and will let you know the results.  If you want to see what it looks like now, you can use this URL    http://tracking.jornik.com

                   

                  You won't be able to perform a real search without the knowledge of "your order" in the system, but if you were to click on any of the areas in the header that have invisible FM buttons, you should get a new browser window.

                  I'm trying to avoid that.

                   

                  My concern about the behavior of the web viewer is that the _self tag will refresh everything into the web viewer instead of refreshing the overall layout itself.  I am able to use the Close Window command, but that reverts to the IWP Home Page which I also want to avoid.

                  • 6. Re: Open URL command in IWP
                    steve_ssh

                    dburnham wrote:

                     

                    My concern about the behavior of the web viewer is that the _self tag will refresh everything into the web viewer instead of refreshing the overall layout itself.  I am able to use the Close Window command, but that reverts to the IWP Home Page which I also want to avoid.

                     

                    This concern that you mention is why I say to use _top for your target attribute value.

                     

                    You are correct: Using _self will load content into your webviewer, and that will not be what you want.

                     

                    Try using _top.

                     

                    In IWP, the user is within a frameset that, in this case, you want to break them out of.  Using _top will do this -- it makes the target the topmost level of their frameset, i.e. the browser window/tab that they are in.

                     

                    Please try it and see if it makes sense.

                     

                    Of Note:

                     

                    Just glancing at the window without realizing that there are frames beyond the iframe for the header, one might imagine that _parent would be the correct target value, but using _parent has two issues:

                     

                      1) It would not break you out of the frameset -- the user would still be within the greater IWP frameset.

                     

                      2) Some browsers will prohibit such a maneuver as a security measure -- the iframe source is not considered trusted to access the parent frame in this manner.  I wasn't sure if this would be the case or not, so I tested it, and quickly found that this is the case for Safari on OSX 10.6.8.  The data/url content in the iframe is treated as not being from the same domain as the parent page in which it lives.

                     

                     

                    In summary:

                     

                    - Try using:  _top  as the value for the target attributes of your links.

                      - Test this in all the browsers that you wish to support.

                     

                     

                     

                    Hope this helps.  Best,

                     

                    -steve