1 2 Previous Next 18 Replies Latest reply on Jun 28, 2017 3:34 PM by philmodjunk

    Webviewer reloads when creating a record in another table

    DikkeHenk

      I've built a Filemaker (12 advanced) separated model solution. The front is holding a webviewer.

      When I create a record from the frontbase in one of the tables in the back. The webviewer in the front table reloads.

      Is that still happening Filemaker 16. I've heard it has another render engine ??

      If so. Does someone knows how to prevent it

       

      Henk

        • 1. Re: Webviewer reloads when creating a record in another table
          philmodjunk

          Are you changing layouts, creating the new record, then changing bacK?

           

          If so, try creating a new window, change layouts, create the records, close the window or try using MagicKey to create the new record without having to change layouts.

          • 2. Re: Webviewer reloads when creating a record in another table
            beverly

            What is your calculation to "load" the Web Viewer?

             

            I like to have a "toggle" so that I can test to load or not.

            If (table1::toggleWV ; <<my WV calc ) // only load if field is true/1

            Or you can script it with:

            "Set Web Viewer" (named WV object)

            Beverly

            • 3. Re: Webviewer reloads when creating a record in another table
              DikkeHenk

              Thanks for answering so quickly,

               

              I am running a Javascript timer/clock in the webviewer that has to be kept running while I am creating sports-game-event-records. So I cannot reload. The javascript-code is in a file with all img-src's inline. (cannot use a server-solution because WiFi is not always available)  I am also not using a data URL because I am passing clocktime-gameperiod ... etc. to Filemaker in the hash-fragment of the URL.

               

              PhilmodJunk

              I go to a new Layout but stay at the front (freeze window) - create the event-record in the other table - return to the original layout- no changes are seen in the front (has to stay like that), except that the webviewer is reloading (timer starts all over).

               

              What's MagicKey ?

               

              Henk

              • 4. Re: Webviewer reloads when creating a record in another table
                philmodjunk

                Freeze Window only affects the current window while the script is running. You get a window refresh when the script ends and I suspect that this is what is reloading your web viewer.

                 

                If you open a new window, which can be hidden off the monitor edge unless you are using FileMaker GO, you can do all the work in that window and close it, leaving your current window untouched and that will probably avoid a web viewer reset.

                 

                MagicKey is a special relationship based method that makes it possible to create/edit records in a related table without having to change layouts. You can web search the term and find a number of excellent articles on the subject.

                • 5. Re: Webviewer reloads when creating a record in another table
                  user19752

                  If your web viewer is in body part, it is reloaded when record is loaded, so changing layout or creating new window also reload.

                  • 6. Re: Webviewer reloads when creating a record in another table
                    philmodjunk

                    But that will reload the web viewer in the new window that is hidden will it not?

                     

                    I'd expect the current window to stay unmodified by such a script.

                    • 7. Re: Webviewer reloads when creating a record in another table
                      user19752

                      I'm not sure but reading

                      I am also not using a data URL because I am passing clocktime-gameperiod ... etc. to Filemaker in the hash-fragment of the URL.

                      I thought same javascript code reloaded in new window could be trouble in this case, if webviewer is pushing value with fmp: protocol. (But now I reread this, why can't use Get() function for clocktime??)

                       

                      I prefer your MagicKey method, but I didn't tested it so wrote only a fact.

                      Creating new window increase complexity if there is script trigger (otherwise I like it).

                      If the web viewer is not in body (I tested header) it is not reloaded on changing layout etc.

                      • 8. Re: Webviewer reloads when creating a record in another table
                        user14047

                        If WebViewer is set to data:text/html; ...,

                        it will be reloaded when the value of the field value or global variable used in the formula changes.

                        • 9. Re: Webviewer reloads when creating a record in another table
                          user19752

                          I missed FM16 introduced "Using layout" option in "New Window" script step, so it can create new window without loading current layout.

                          (There is no option that make hidden nor minimized, but set position to out of desktop may work better than MDI with old versions on Windows)

                           

                          Apologize, my test looks had some mistake, now I saw it is reloaded if webviewer is in header part...

                          • 10. Re: Webviewer reloads when creating a record in another table
                            sam_oda

                            Hi,DikkeHenk

                            Data passing via onhashchange event really works correctly?

                            Did you debug the code?

                            • 11. Re: Webviewer reloads when creating a record in another table
                              DikkeHenk

                              Sam_Oda,

                              For now I am passing the data one way only from the web viewer (with Javascript) into Filemaker. In Javascript I am using 'document.location.hash' and reading that in FM with 'GetLayoutObjectAttribute' looking for the position of the '#' character and concatenating the found string. Then putting the values in variables and that works OK.

                              The other method I am gonna use with the FMP protocol is already written in the Javascript code. Start, pause, resume, period-start, period-end and game-end will trigger Filemaker scripts. But I am still on FM12adv. and have to upgrade. I also want the possibility  to get the timer/clock work with different game-times. For that I need the 'onhashchnage event' to alter game-times. I've already looked into that and I think it's not too difficult.

                              I spent a lot of time to get knowledge about working with the hash-fragment in a data-url which is not possible. That's why I am using the local-file solution now (temporary folder) and that works great. I've built an all-inline code (CSS, HTML, Javascript and base64-image-src-var's are in one file) and that file is loaded in the web viewer.

                              I am still looking for a propper way to keep the clock running while creating records in an other table. The final solution has to work in Filemaker Go.

                               

                              Henk

                              • 12. Re: Webviewer reloads when creating a record in another table
                                sam_oda

                                Henk:

                                Basically web viewer doesn't reload in such case as you said, I think,

                                strange...

                                Isn't there script triggers that reset the web viewer?

                                Does it occur only on creating records?

                                • 13. Re: Webviewer reloads when creating a record in another table
                                  DikkeHenk

                                  Sam,

                                  I commented out the 'new record/request' but the web viewer is still refreshing.

                                  script steps are:

                                   

                                    Freeze Window (to stay at the front with the clock/timer in it)

                                    Go to Layout (the layout/table where the new record has to be created)

                                    New Record/Request (// disabled it but the web viewer keeps refreshing)

                                    Go to Record/Request/Page [Last]

                                    //Commit Record/Request [] (for now commented out)

                                    Go to Layout [Original Layout]

                                   

                                  Fields in the related table are almost all auto-enter. I am parsing a big string with separation characters in a Global variable that's concatenated when the record is created. Each field then 'takes' it's own value from the list.

                                   

                                  I think it has something to do how Filemaker is rendering it's layouts. That's why in my first question I asked about the rendering engine of FM16.

                                  I heard it was rendering in a different way.

                                   

                                  Henk

                                  • 14. Re: Webviewer reloads when creating a record in another table
                                    philmodjunk

                                    To repeat a suggestion, why not do it this way?

                                     

                                    New window

                                    Go to Layout (the layout/table where the new record has to be created)

                                      New Record/Request (// disabled it but the web viewer keeps refreshing)

                                      Go to Record/Request/Page [Last]

                                      //Commit Record/Request [] (for now commented out)

                                    Close window

                                     

                                    You can specify a window size and position that puts it off the top or left edge of the screen so that it is hidden from the user. In FMP 16, you can remove the go to layout as you can now specify the layout in the new window step.

                                     

                                    Another option is to put your web viewer in its own floating document window or card (v 16 option again) from the start.

                                    1 2 Previous Next