8 Replies Latest reply on Apr 20, 2013 4:07 AM by steve_ssh

    Layout with related Portal detail wont display

    miketurton

      Hi, I am developing a database using FM Pro Advanced 12, that will reside in a remote FM server and be accessed via IWP. This is my first foray into IWP and I have come accross the following issue.

       

      I am using browser Firefox 10.0.2 on macbook pro mid 2010

       

      Table setup and relationships:

       

      TO_SYMP (Symposium table with __kp_SymposiumID and joined to symp_SYMPDET table via _kf_SymposiumDetailID). This table holds things like Symposium Date, No of Days, Venue and Purpose.

      TO_symp_SYMPDET (Symposium Detail table with __kp_SymposiumDetailID and _kf_ClientID). This table holds details of a Client's Name (via relationship with CLIENT table, Registration Date for an event and whether they confirmed and attended.

      TO_symp_sympdet_CLIENT (Client table with __kp_ClientID which is joined to SYMPDET table via its _kf_ClentID). This table contains Client contact details some of which are pulled into the Portal.

       

      Layouts:

      'Symposium List' which displays records from TO_SYMP table occurence

      'Symposium Detail' which displays records from TO_SYMP in the Header section with a Portal in the Body that displays relating records from table TO_symp_SYMPDET. The portal rows contain the following fields:

      • Client Name from TO_symp_sympdet_CLIENT
      • Clent Phone from TO_symp_sympdet_CLIENT
      • RegisterDate from TO_symp_SYMPDET a field that uses Get (CurrentDate) to auto populate
      • Confirmed text field from TO_symp_SYMPDET ( this is a radio button Yes/No set with a scripted button to toggle the setting)
      • Attended text field from TO_symp_SYMPDET ( this is also a radio button Yes/No set with a scripted button to toggle the setting)
      • Notes text field from TO_symp_SYMPDET

       

      The Client Name sources data from a popup value list which uses the Client Name (a calculation field in CLIENTS table that appends LastName&", "&FirstName)

       

      To select the Symposium Detail I have a button from the List Layout that picks up the __kp_SymposiumID and then goes to Layout 'Symposium Detail' and finds the record.

       

      This displays fine in my local database but tesing IWP via localhost, this detail layout wont come easily and the browser times out after many minutes with this error:

       

      [A script on this page may be busy, or it may have stopped responding. You can stop the script now, or you can continue to see if the script will complete.

       

      Script: http://localhost/fmi/iwp/res/calendar.js:12]

       

      If I stop the script I can edit the record.

       

      I dont understand this script as I did not call it.

       

      I have noticed that if I only have a couple of detail records it displays but once the portal records increase over about 12 it just wont display until the timeout.

       

      How do I cope with this

       

      Please help.

       

      Thanks in advance

       

      Mike

        • 1. Re: Layout with related Portal detail wont display
          steve_ssh

          Hello Mike,

           

          A couple of questions:

           

            1) Is the errror message always the same? In particular, is it always pointing the blame on the script:  calendar.js  ?

           

            2) Do the symptoms change at all if you remove the RegisterDate field from the portal?

           

          I believe that calendar.js is the script that operates a pop-up calendar for date picking.  I can't imagine why it would need to be invoked at page-load, but if it is being invoked for some reason, it could be that things are not designed for a use case where it is being called a number of times in sudden succession (once per portal row).  This is all speculation, mind you, but a reasonable first stab at the problem would seem to be if we can isolate this one part of the code that our only clue points to, and see whether or not it genuinely appears to be the source of the problem.

           

          Best regards,

           

          -steve

          • 2. Re: Layout with related Portal detail wont display
            miketurton

            Hi Steve,

             

            Thanks so much for getting back to me and for your thoughts.  

             

            Answers:

             

            Q1.  yes the error is always the same, always blaming calendar.js

             

            I also put the database up on the remote server and got the same message with the remote servers URL instead of local host but it still blames calendar.js

             

             

            Q2.  Yes it does change if I delete the RegisterDate from the portal row.   The error does not come but the layout takes around 10.5 minutes to display which is approximately the time it took to bring the error before.   Obviously my client (or me for that matter) wants to wait 10 minutes for a screen to appear.

             

             

            Here are some more contextual notes and then some more testing results:

             

            The database I have contains close to 7,000 contact records of which 94 are registered for the Symposium in question so we have 94 portal records.   When I go to my Contact List layout it takes about 1.5 seconds to bring the layout of the first 25 but the counter shows 6985 for example

             

            Further investigaion;

            I created a new Symposium and then went to the detail layout from the list and it took about 11 secs to bring an empty layout for me to add Title text and Symposium Date ect  ( incidently I changed this Symosium date field to a text field to avoid bringing the dropdown calendar).

             

            I added one portal row  at a time up to 5 then went out of the layout to my contact list and then back in and measured the time to display.  Here are the results.

             

            0 portal rows     11s

            1 portal row      19s

            2 portal rows     23s

            3 portal rows     27s

            4 portal rows     33s

            5 portal rows     38s

             

            I did this a couple of times and while the times were slightly different the trend is the same. 

             

            it also takes the same time to get to edit the record, for exmaple once committed, I wanted to edit the Symposium title or add another person and if I had 4 portal rows it takes about 33s to open the layout for edit.

             

            I then took 10 minutes that it takes for the 94 to display subtracted 11 seconds and then divided the 589 result by 94 and I get 6.3 which seems to me to be not too far of a stretch from the exact trend that I noticed with my test.

             

            Is that how portal rows behave on IWP or does it indicate something else that is possibley wrong.  

             

            The name field in the Portal row is a popup that does take some time to display if for example I click a field that has this contact name list as the value list.  I noticed that when the layout did finally display it is in an editable state where each portal row Name field has an active popup ready to go.   Maybe this is the culprit.

             

            Just thought of that while I was typing ... so will go and try and come back.

             

            Regards,

            Mike

             

            ----------------------

             

            Message was edited by: miketurton Yes it does.   I changed the Contact Name field from a popup to a text field and the form snapped open.   Ok now I understand what is taking the time, how do I handle this.   I want to be able to pull existing contacts to the Symposium so I can pull other details without getting duplicates.   Naturally my Portal Row Name value list Displayed LastName, FirstName but stored the ID in the field but now I can not use the popup, I am not sure how to solve this. Do you have any ideas for me? Thanks in advance Regards, Mike

            • 3. Re: Layout with related Portal detail wont display
              steve_ssh

              Hi Mike,

               

              Thanks for your reply.

               

              Based on your last post, I'm no longer harboring suspicions about the calendar.js code.n  It's likely just an innocent bystander.

               

              You are thinking along the right lines by taking a look at the pop-up menu.  If that pop-up menu takes a lot of overhead to calculate, and it's being calculated multiple times (once per row) and it is sending a lot of (redundant) data to the browser, it's going to add up to a long delay.  It seems to me that the next sensible thing to do is what you are probably doing right now:  Try removing the value list from the field, and temporarily turn it into a regular edit field.  I'd be curious to know what happens.  The interesting thing is that this would really only explain the delay with respect to going into edit mode.  In view mode, this shouldn't be rearing its head.  Thus, there may be more pieces to examine.

               

              In general, try to think of anything that costs more than a little overhead (typically some sort of operation which has to pull records through a relationship, e.g. create a dynamic value list, perform an aggregate function, etc.) and imagine this being multiplied by the number of rows in your portal, and then imagine this being slowed down a bunch by virtue of the fact that it is coming through the IWP engine, and it will quickly make sense when you hone in on something.

               

              I look forward to hearing what you discover.

               

              Best,

               

              -steve

              • 4. Re: Layout with related Portal detail wont display
                steve_ssh

                ----------------------

                 

                Message was edited by: miketurton Yes it does.   I changed the Contact Name field from a popup to a text field and the form snapped open.   Ok now I understand what is taking the time, how do I handle this.   I want to be able to pull existing contacts to the Symposium so I can pull other details without getting duplicates.   Naturally my Portal Row Name value list Displayed LastName, FirstName but stored the ID in the field but now I can not use the popup, I am not sure how to solve this. Do you have any ideas for me? Thanks in advance Regards, Mike

                 

                Hi Mike,

                 

                So, do I correctly understand the scenario?:

                 

                1) The portal displays a bunch of rows

                 

                2) The present UI design also allows the user to create new records via the portal?

                 

                3) Part of creating a new record involves selecting a value from a value list.

                 

                4) Including that value list on a field in the portal is dogging the system terribly.

                 

                 

                If the above is the case, I think the easiest solution for you to realize is to modify the UI so that new record creation takes place somewhere outside the portal.  It could be on another layout, or elsewhere in the same layout, for example.  This would mean that the value list would only be calculated and sent to the browser once, as opposed to many, many times.  I believe that would be your easiest option.  If I think of something equally feasible and better, I will be certain to post back.

                 

                Best,

                 

                -steve

                 

                 

                p.s.  How many value are in the value list at present?

                • 5. Re: Layout with related Portal detail wont display
                  miketurton

                  Hi Steve,

                   

                  Yes you have understood my scenario exactly.

                   

                  I understand your concept of creating the new record outside the portal and will think on how to do this while maintaining intuative user interaction.

                   

                  Thanks for all the time you have spent helping me.

                   

                  At present there are close to 7,000 records in the value list with last name first so I bring the list up and then type the first few characters to get to the right area of the list to pick a name to store in the new record.   It is redicusously long but I am at a bit of a loss on a better way to do it.

                   

                  Maybe if I can create a QuickLook text field that I can use to do a search of the main list with each character I type and reduce the list until I can see the name I want and pick it then use this to create the new record.    Not sure if this will work well with the web/host interaction either but a thought.

                   

                  What do you think of this approach.

                   

                  regards,

                  Mike

                  • 6. Re: Layout with related Portal detail wont display
                    steve_ssh

                    Hi Mike,

                     

                    7000 records is certainly a lot to put in a value list.  I'm impressed that the whole system made it as far as it did. 

                     

                    Anyhow, now that the problem is identified, my suggestion would be to make a new post here at the forum, soliciting some UI concepts for how to allow a user to pick selections from such a large range of values in an intuitive/efficient manner (in particular, in a manner which will be viable using WebPublishing and/or IWP).

                     

                    There are a lot of people here who have really terrific UI concept skills, but, unfortunately, I am not one of them -- my skills in that regard are probably mediocre+ at best.

                     

                    I think that, with some good ideas to try for a UI concept that allows for elegant selection from a list of size 7K, as well as with a little bit of experience and discovery regarding which FileMaker features carry over to IWP in a feasible manner, you will have a good background to take a new stab at this endeavor.  If I had a good UI concept to offer for picking from a list that large, I'd toss it out for consideration, but I don't feel that I do.  I'm sure that some of the other developers on the list will be able to offer some excellent and experienced suggestions.

                     

                    Very best,

                     

                    -steve

                     

                    p.s. You could, of course, just continue the discussion here, but I think you'd probably get a richer range of answers if it is clear that the topic has evolved to good UI design versus troubleshooting slow IWP response.

                    • 7. Re: Layout with related Portal detail wont display
                      miketurton

                      Hi Steve,

                       

                      Thanks for your help.   You got me thinking on a path so at least we now know what the prob is.  I will start a new post as suggested.

                       

                      Appreciate all you have done.

                       

                      Cheers

                      Mike

                      • 8. Re: Layout with related Portal detail wont display
                        steve_ssh

                        Hi Mike,

                         

                        You are very welcome.  Glad to help a little bit.

                         

                        Good luck!

                         

                        -steve