9 Replies Latest reply on Jul 15, 2010 1:12 PM by BreitenbushIT

    IWP - Display Message while user waits for layout to load.

    BreitenbushIT

      Title

      IWP - Display Message while user waits for layout to load.

      Post

      Hello Wise People,

       

      I have a database that is accessed via Instant Web Publishing.  When users log in they see a list of buttons to click on.  The buttons take them to various reports by going to a different layout.

       

      The issue is that some of the layouts take a few seconds to load because of large amounts of data being displayed.  I want users to see a message such as "Please wait while your report loads..." during the short wait.  This will ensure them that they did click the button and prevent them from clicking it again.  

       

      I have tried to implement this feature by creating a layout with the message above, and having the button script first go to the message layout and then go to the report layout.  Unfortunately the script behavior is such that the message layout doesn't display to the user.  It seems like the way scripts work in filemaker is that they want to do all the script steps before they change what the user is seeing.  

       

      Any ideas of how I can do this? 

       

      Thanks!

      -shawn-

        • 1. Re: IWP - Display Message while user waits for layout to load.
          BreitenbushIT

          Here is an example script that demonstrates what I am talking about:

           

          Go to Layout ["Message"]

          Set Variable [$Count; Value:1]

          Loop

            Set Variable [$Count; Value:$Count + 1]

            Exit Loop If [$Count = 999999]

          End Loop

          Go to Layout ["Final Layout"]

           

          Lets say you are on a layout called "Main Layout" and you click a button that runs the above script (in Filemaker or IWP).  What happens is that the script works for awhile on the loop (while still displaying "Main Layout") and then puts you into "Final Layout".  You never see the "Message" layout during the process.

           

          -shawn-

          • 2. Re: IWP - Display Message while user waits for layout to load.
            BreitenbushIT

            I am still looking for a solution to this.  I have done a fair amount of experimenting and still can't figure out an obvious way achieve the desired results.  Anyone have any ideas?

             

            -shawn-

            • 3. Re: IWP - Display Message while user waits for layout to load.
              BreitenbushIT

              I have been searching all over trying to find a solution to this and have not yet had success.  I have found some clever solutions for creating a progress bar, but they all utilize conditional formatting which is not available in IWP.

               

              So once again, my question is:

               

              How can I have let the user know that a script is currently running when they are logged into my database via IWP?  I don't need something as elaborate as a progress bar, just simple message that displays while the user is waiting for the script to complete.  

               

              There must be a way to do this?  Anyone?

               

              -shawn-

              • 4. Re: IWP - Display Message while user waits for layout to load.
                philmodjunk

                I've hesitated to post a suggestion as I don't have an IWP database to test this on, but what happens if you add a commit records immediately after you go to the message layout?

                • 5. Re: IWP - Display Message while user waits for layout to load.
                  BreitenbushIT

                  Hi Phil,

                   

                  Thanks for the suggestion.  I tried your suggestion and unfortunately it didn't work.  I actually tried two methods.  I will paste the script for each method below:

                   

                  Go to Layout ["Message" (Globals)]

                  Commit Records/Requests [No dialog]

                  Set Variable [$Count; Value:1]

                  Loop

                     Set Variable [$Count; Value:$Count + 1]

                     Exit Loop If [$Count = 90000]

                  End Loop

                  Go to Layout ["Report" (Report)]

                   

                  When I ran the above script, it just paused for awhile while the loop ran, and then showed me the "Report" layout.  I never saw the "Message" layout.  This is both in FM and in IWP.

                   

                  Set Field [Globals::test ; "Message"]

                  Commit Records/Requests [No dialog]

                  Set Variable [$Count; Value:1]

                  Loop

                     Set Variable [$Count; Value:$Count + 1]

                     Exit Loop If [$Count = 90000]

                  End Loop

                  Go to Layout ["Report" (Report)]

                   

                  I also tried the above script where I added the "test" field to the starting layout and also inserted into a text block as a merge field to see if that behaved differently.  When I ran that script in FM the field displays the message after a second or so (there is definitely a delay), but the merge field never displays anything.   In IWP the message is never displayed.

                   

                  Back to the drawing board.  :)

                   

                  -shawn-

                  • 6. Re: IWP - Display Message while user waits for layout to load.
                    BreitenbushIT

                    I am still seeking a solution to this.  Anyone?  It sure seems like this should be possible.

                    -shawn-

                    • 7. Re: IWP - Display Message while user waits for layout to load.
                      fitch

                      Shawn, I admire your persistence.

                      Have you tried Refresh Window before your Loop?

                      • 8. Re: IWP - Display Message while user waits for layout to load.
                        Steve Wright

                        Ive tried a number of things to obtain this behaviour myself, in hope to answer your question..

                        Unfortunately I have not been able to achieve it either.
                        I even went as far as going to a layout refreshing the window and ending the first script, then using a script trigger run the processing script, that didn't work either..

                        I guess its a 'feature' of IWP to stop it having to load layouts unnecessarily thus saving on traffic.

                        • 9. Re: IWP - Display Message while user waits for layout to load.
                          BreitenbushIT

                          Hello Fitch and SWS,

                          Thanks for the suggestions and thoughts!  

                          Fitch - I just tried the refresh window script step right before the loop.  It works great in FMP but unfortunately does not make any change when running the script with IWP.  <sigh>

                          I still refuse to believe that this isn't possible with IWP.  If there really isn't a solution then I feel it needs to be added because this seems like something that should be possible.  :)

                          -shawn-