8 Replies Latest reply on Apr 9, 2014 9:56 PM by StanMillar

    Cross Post window refresh/display issue

    StanMillar

      Hi all

       

      I posted this to FM Experts yesterday but haven't yet received a reply.

       

      I have just come across an issue since the recent update to FMP13.0.2.22. Mac OSX 10.9.2. Using FM advanced.

       

      I have a menuing system that operates as follows:

       

      Click on a menu item in a portal which runs a script:

       

      Go to a developer layout attached to the Menu TO

      determine if the menu item clicked has sub-menu items

      If it has, change the arrow displayed beside the menu item clicked (gives the same effect as clicking on a folder in the Finder)

      load up the sub menu IDs into fields so that they display in the menu portal on the original (home) layout and some other housekeeping

      return to the home layout where the arrow has changed to the new graphic (pointing down) and the top level menus and the sub menus from the one clicked are displayed. Well - no.

       

      All this has worked perfectly for years.

       

      Since the upgrade, the script runs, the arrows change BUT the sub menus refuse to display. On the developer layout, I can see that things have changed to add the sub menu IDs into the correct fields for display.

       

      If I manually navigate to the developer layout from the home layout and then immediately return to the home layout - there they are - displayed in all their glory!

       

      I have tried:

      add refresh window after returning to the home layout. No change.

      add commit record both before and after returning to the home layout. No change.

      add steps to navigate to the home layout, back to the developer layout and back to the home layout . No change.

       

      If I open the file in FM12 Advanced, everything works.

       

      Seems like something has changed since the update. I hate to say the "b"(ug) word but nothing else has changed.

       

      Any suggestions? Anyone else having a similar problem?

       

      Stan

        • 1. Re: [Cross Post] window refresh/display issue
          StanMillar

          Additional info:

           

          The menu portal on the home layout shows the menu records via a multi-predicate relationship. In all cases, the top level menus continue to display. This is the correct behaviour as their IDs are listed in the foreign key field.

           

          The opposite effect occurs if the user (me) clicks to "close" a menu. The arrow changes, as it should, but the sub-menus continue to display. I can verify that their IDs are removed from the foreign key field.

           

          Puzzling.

           

          Stan

          • 2. Re: [Cross Post] window refresh/display issue
            Stephen Huston

            I can't say that I'm certain what you are doing with your menus from the discussion, but it sounds like you are trying to refresh items in a portal row.

             

            Things may well have changed with the new release, but one thing has been an ongoing problem with portal refreshes -- the need to commit the parent record before the child record can be fully committed and flushed.

             

            I would try capturing the portal row/field info to variables, committing the parent record after the changes, and then returning to the correct location to get the refreshed portal row content.

            • 3. Re: [Cross Post] window refresh/display issue
              StanMillar

              Hi Stephen

               

              Thanks for the reply.

               

              I tried that - no change.

               

              Sorry.

              • 4. Re: [Cross Post] window refresh/display issue
                Stephen Huston

                Any luck with the Refresh Object script step (down in the Misc script step category), after a commit with flush cache?

                • 5. Re: [Cross Post] window refresh/display issue
                  StanMillar

                  Just tried that.

                   

                  There is no flush cache available with that instance of commit. I know what you are talking about, though.

                   

                  Curioser and curioser.

                  • 6. Re: [Cross Post] window refresh/display issue
                    StanMillar

                    Too quick with the submit button:

                    Didn't work.

                    • 7. Re: [Cross Post] window refresh/display issue
                      StanMillar

                      Hi Stephen

                       

                      I just added the separate step to flush to disk.

                       

                      Still no change to behaviour.

                       

                      Thanks for your help.

                       

                      ADDED:

                      Just added a new portal to the home layout showing the menu name field and the fk field then manually copied the IDs into the fk field in this portal. This worked. The menus showed up in the menu portal.

                       

                      New wrinkle.

                       

                      The sub menus (the correct ones for that top level menu) show up in the menu portal only _after_ the top level menu is "closed" and their IDs are _removed_ from the fk field by the script!! At this stage in the process, they are _not_ related.

                       

                      There is something very strange going on here. To say the least.

                       

                      I added a fresh instance of the menu portal to the home layout. The result is the same so it is not a problem with the original portal.

                       

                      Message was edited by: StanMillar

                       

                      Update:

                       

                      Workaround

                       

                      If I pause the script for .55 (yes .55) seconds after flushing the cache and before returning to9 the home layout, it works as expected. Any delay less than .55 seconds does not work.

                       

                      Stan

                      1 of 1 people found this helpful
                      • 8. Re: [Cross Post] window refresh/display issue
                        StanMillar

                        SOLVED:

                         

                        If I open the developer layout in a separate, hidden, window, all the problems go away without any pauses in the script.

                         

                        How this differs in refreshing the window from using the script step, I don't know, but at least it works.