2 Replies Latest reply on Aug 23, 2011 7:33 AM by dhafitch

    Web Viewer Problem



      Web Viewer Problem


      Is there a way to make FMP web viewer recognize your URL without entering the http://?

      e.g. when using www.google.com instead of http://www.google.com?


      FMP11 for Mac

        • 1. Re: Web Viewer Problem

          The web viewer URL box is a calculation box that can combine data from  fields in your current record. If you want you can set the web viewer to use this expression:

          "http://" & yourTable::URLTextField

          In which case, you can type or paste "www.google.com" into this text field and the calculation will add the missing text to the URL. You can even use an If function to test for the presence of "http://" in the text field and supply it only if it was not typed into this field.

          • 2. Re: Web Viewer Problem

            It is also possible to use the "data URI schema", which allows composing html directly in the web viewer, making html pages on the fly using data pulled directly from the database.  This works great for simple html pages.  For example, if you want to incorporate latitude and longitude data from your database to show a map using a web viewer object, you could set the web viewer to the following (either directly or through a global variable):

            <body bgcolor='#FFFFFF' TopMargin='0' style='border:0'>
            <iframe width='"
               & GetLayoutObjectAttribute ( "MAPVIEWER" ; "width" ) - 10
               & "'height='" & GetLayoutObjectAttribute ( "MAPVIEWER" ; "height" ) - 10
               & "'frameborder='0' scrolling='15' marginheight='0' marginwidth='0'
               src='http://maps.google.com/maps?q=" & TABLE::LATITUDE & "," & TABLE::LONGITUDE & "&output=embed&iwloc=0'>
            </html> "

            Of course, substitute your web viewer's object name (the name of the web viewer in the Position tab of the Inspector for the Layout) for "MAPVIEWER" and the names of your fields containing the latitude and longitude data for TABLE::LATITUDE and TABLE::LONGITUDE, respectively.

            ( BIG PROGLEM, HOWEVER:  I have not been able to get a GoogleMaps javascript script to work in order to map MULTIPLE points.  Does anyone have a (simple) suggestion that would allow this to be done WITHIN such a WebViewer data URI schema?  (I've written several nice scripts to do this, but NONE have worked within the data schema.  And solutions (posted elsewhere) either do not work for the Web Viewer in FileMaker or require an Export step to generate an html file, the URL of which is then used to set the Web Viewer.  This does not seem to be a good solution for FM Server, however, since the export field step is incompatible with Server.  I would be overjoyed if anyone has a simple solution to this problem! Simple solutions can be very powerful! )