9 Replies Latest reply on Jan 27, 2012 5:11 AM by ChrisMoyer

    Odd web viewer behavior in Go

    ChrisMoyer

      So just ran into a weird issue with the web viewer in FMGo. I've been using the web viewer to do lightweight synching with a hosted database. I have a PHP page that serves up new records when they're ready to download to the Go application. My preference in PHP is to double quote the line and single quote quoted elements within the line. For example:

       

      echo " value='{$request['web_listing']}'></td> ";

       

      It's a personal preference, I don't like having to escape double quotes within the line, so I use single quotes. I have a routine within FileMaker that screen scrapes the web viewer and parses the strings. Everything worked fine when I tested on FileMaker desktop, but when I loaded it onto Go, it broke. After much poking around, I discovered that the web viewer on GO converts single quoted text to double quoted text. In a web browser, and in the web viewer in FileMaker desktop, I'll get this string in the page source:

       

      <td><input type='hidden' name='' value='36|1784|77|9/9/2011|[4^2^1^37^][2^2^1^^]'></td>

       

      but in FMGo, I get:

       

      <td><input type="hidden" name="" value="36|1784|77|9/9/2011|[4^2^1^37^][2^2^1^^]"></td>

       

      Anyway, it broke my parsing logic. Easy fix, but I thought I'd pass it along. Heads up.

       

      Chris

        • 1. Re: Odd web viewer behavior in Go
          LyndsayHowarth

          funny... my personal preferences would have seen me doing the opposite:

           

          echo '        value="{$request['web_listing']}"></td>\n';

           

          I will have to test this further in GO.

           

          Lyndsay

          • 2. Re: Odd web viewer behavior in Go
            ChrisMoyer

            Here's another one:  I've been using an XML call in a web viewer to push records from FMGo up to the server while on a 3G network connection that may or may not be there.  To detect whether or not I got a response back from the server, I used GetLayoutObjectAttribute ( "RequestPage" ; "content" ) to see if there was anything in my web viewer (called RequestPage).  On FileMaker desktop (on a Mac), content would be empty, so I could use:

             

            Length ( GetLayoutObjectAttribute ( "RequestPage" ; "content" ) ) = 0

             

            ...as my test to see if the push had failed or not.  It didn't work on FMGo.  On FMGo, I had to use:

             

            GetLayoutObjectAttribute ( "RequestPage" ; "content" ) ≠ "<html></html>"

             

            ...because the web viewer on FMGo contains <html></html> when it's "empty".

             

            FYI.

            • 3. Re: Odd web viewer behavior in Go
              beverly

              Wow, is the "content" supposed to get what would be inside the "<html></html>"? Have you tried with IsEmpty() and would that be different from Length() = 0?

               

              Must test....

               

              thanks for the I,

              Beverly

              • 4. Re: Odd web viewer behavior in Go
                reelsteve

                hola chris.  i use this approach quite a bit and it works pretty darn ok.

                we use our own api to make calls to which in turn does all the direct to filemaker server xml gateway heavy lifting.  This keeps our server well protected and also allows for a much more enjoyable api to make calls to.

                fm server passes the return to our ApI which then returns it to the originating client.  It allows for the data to be returned as whatever u ask for (xml,json, list,html,csv, any delimiter u want , etc).

                the api also returns result codes amongst a bunch of other "addOn" data we then use for a variety of purposes.  This was a long winded lead up to my reply to ur post - we include. success code and indicators for errors.  I have our ApI seperating everything with a double tilda, making it easy to section out and parse up.  not exactly sure why we chose the dbl tilda?!? seemed pretty rare to get one back otherwise.  also a big fan of mexican food....for that matter my wife is mexican so she was of crs thrilled to be represented in my substitution functions ;)

                • 5. Re: Odd web viewer behavior in Go
                  reelsteve

                  quick add that i just remembered...i use to include a script in all my calls that in addition to doing whatever the call was doing , i wld hit a global with a setField and then used a separate transparent container field with conditional formatting set to fill tielBlue when the global i mentioned got pinged.

                  i made a graphic of star trek's ohura and placed the little container field into her earPiece that was so famous.  i used a picture where she looked super intense as she was listening, likely due to some romulan assualt just around the corner.  it gave me an easy to spot visual reference that my call had made it and i scripted the sequence with some standard transactional architecture so the global set field could only occur after the other calls were successful.  This meant that a blue light in ohura's ear wasnt just me poking at the server, it was certification of the job being done (not fullproof which is why we adopted return codes).  When in doubt , go obura ! i can dig her up for u if you want !

                  • 6. Re: Odd web viewer behavior in Go
                    LyndsayHowarth

                    so you are telling me that I shouldn't have bothered adding "<html>"& blah &"</html>" in all those calculations! I could have saved countless seconds over the years. We may be talking here about potentially hours of my life that were wasted!

                     

                    - Lyndsay

                    • 7. Re: Odd web viewer behavior in Go
                      beverly

                      Lyndsay, if you are talking about using the "data:text/html," in the web viewer, it's is perfectly legal to have a "snippet" of an html page. That is it's intent. See articles on "RFC 2397 - The "data" URL scheme".

                       

                      If not, NEVERMIND...

                      Beverly

                      • 8. Re: Odd web viewer behavior in Go
                        LyndsayHowarth

                        LOL...

                        I've used it plenty without....

                        .... and it does say it is getting data from text or html

                        .... and in terms of whittling away my life on FM things it rates very low...

                        I think I have even read that RFC...even though it often the last place I think to look.. doh!

                        - Lyndsay

                        • 9. Re: Odd web viewer behavior in Go
                          ChrisMoyer

                          LOL! Thanks for the laugh.  I like the API idea.  Lots of usefulness there.  The data that's moving around in my case is low-security, but the API could be used for an additional security layer.  You could even use it to implement realms.