4 Replies Latest reply on Feb 26, 2012 2:38 PM by Malcolm

    Web Viewer Events in GO

    BalkanCovek

      Dear Fellow Developers,

       

      Is there a way to trap events on the Web Viewer in a database being run on GO? Basically, I want to provide dynamic content in a Web Viewer control that has links and have those links execute a script. For example, navigation between records. It seems that the control can only be written too, but there is no interaction.

       

      Basically I am hoping there is some way to use JavaScript within the HTML to speak to the container (FileMaker) to improve the interaction. Basically it would be like talking to the Application or parent object of the HTML Document and calling some commands.

       

      I am new to GO, so I apologize if I am missing the obvious.

       

      Your guidance is greatly appreciated.


      BC

        • 1. Re: Web Viewer Events in GO
          mdenyse

          There's no 'direct' way, but you could perhaps use CWP, although if you're just trying to navigate records I'm not sure how efficient that's really going to be.

           

          Something you could try (I don't know how well this would work) is to constantly run a timer script that scrapes out the HTML of the web viewer. If it detects a change (based on your click setting something via JavaScript), your script could then perform the desired action.

           

          Is there some reason you don't want to use Go's native buttons or buttons your own on the layout?

           

          Mark

          • 2. Re: Web Viewer Events in GO
            BalkanCovek

            Mark,

             

            Thank you for your interesting timer suggestion. That is not a bad idea, though to detect a link change would require about a second to two second timer I think. I am curious about performance in that scenario?

             

            I do plan to use FM controls to aid in the navigation, but basically I want to present rich content with the web viewer and hyperlinking is a very intuitive way to offer additional navigation, however since the content is generated from the database, their is no "backend" web server for it to work against.

             

            I realize that this control is called a "Viewer", which is likely very intentional. However, being that it is likely based on the UIWeb control in iOS, the control does have the internal ability to elevate internal scripting events. So probably wishful thinking on my part that I can catch that some how.  It just seems to me that there should be some scripting triggers which allow you to monitor activity within the control.

             

            Thanks,

            BC

            • 3. Re: Web Viewer Events in GO
              mdenyse

              Try setting the timer to its minimum value and see what the performance is like. I'd guess it won't be suitable but it would be relatively easy to set up and try.

               

              I'm hoping that the next version, whenever it comes out (*cough*) might have some improvements like you want. Just wishful thinking on my part - I too would love to be able to set call back scripts in FM from within the HTML in my web viewer. Maybe someday...

              1 of 1 people found this helpful
              • 4. Re: Web Viewer Events in GO
                Malcolm

                On 27/02/2012, at 2:23 AM, BalkanCovek said:

                Is there a way to trap events on the Web Viewer in a database being run on GO? Basically, I want to provide dynamic content in a Web Viewer control that has links and have those links execute a script. For example, navigation between records. It seems that the control can only be written too, but there is no interaction.

                 

                 

                Basically I am hoping there is some way to use JavaScript within the HTML to speak to the container (FileMaker) to improve the interaction. Basically it would be like talking to the Application or parent object of the HTML Document and calling some commands.

                 

                There isn't a direct method. Scraping the HTML is a possibility but it is lame.

                 

                Look at the navigation framework recently suggested by www.logicurio.com. It uses a combination of web viewer with buttons to achieve the effect. It may give you some ideas.

                 

                Malcolm

                1 of 1 people found this helpful