13 Replies Latest reply on Mar 21, 2017 4:52 AM by argasoft

    Hide portal.




      I have a portal and column names above it (text elements).

      Hiding of portal, fields in portal and text is conditioned with isEmpty ( $$modifying).


      On format load $$modifying is set to "" ==> portal and text not visible.

      A button activates a script to show data in the portal and $$modifying is set to "Y".

      A button on each record in the portal activates a script to choose a record which sets $$modifying to "" again.

      After Refresh Window text above portal and records in portal are not shown (OK), *but* portal frame is shown.


      What's wrong?




        • 1. Re: Hide portal.


          I add three explanatory pictures.OnLoad.pngAfterClick.pngAfterChoosing.png

          • 2. Re: Hide portal.

            Hi Arnjaldo,


            my guess is that you hide the fields on portal rows, but not the portal himself. Please check if on the portal you add a hide condition. Hiding the portal will hide also everything it contains.

            • 3. Re: Hide portal.

              Thank you for the reply.


              The problem here is that FM behaves differently onLoad (pic1) from afterChoosing (pic3), whilst having in both cases $$modifying set to "" (void). Hide condition: isEpmty ( $$modifying).


              Has it something to do with the style I use on active portal record (blue rectangle)?

              • 4. Re: Hide portal.

                In your original post, what do you mean by On format load ? When a Hide condition is changed, the object that has this condition will not necessarily re-evaluate the condition. To be sure it will, you may refresh the object, that will force it to evaluate the Hide if calculation and hide the object if the condition is met. What bugs me is that a Refresh Window should refresh all objects within.


                You don't tell what version you are running, but along the time bugs were corrected with portals.

                • 5. Re: Hide portal.



                  Sequence is:

                  - script voids $$modifying, loads format and refreshes ==> result pic1: no portal, just text with green background that has no hide condition )

                  - click on button (pic2 'clicked' while in pic1) calls a script that sets $$modifying to "Y" and refreshes ==> result pic2: portal with data and some text without background; i.e. the hide condition isEmpty ($$modifying) is interpreted correctly by FM

                  - click on a record in the portal calls a script that voids $$modifying and refreshes ==> pic3 which should be as in pic1.


                  In case of a hide condition for portal and fields, fields are hidden, portal not (should hide both).
                  In case or a hide condition just for the portal, fields and portal are shown.
                  Fields *are* in the portal row, otherwise they wouldn't be visible correclty.


                  There's no layout change in the the scripts.


                  FMPro Adv 15.01


                  Thanks again.

                  • 6. Re: Hide portal.



                    I am puzzled. Since you have FMPA, I would suggest using the debugger to see if step by step would produce a different result. Do you have conditional formatting on the portal or the fields in it ?

                    • 7. Re: Hide portal.
                      FMPro Adv 15.01


                      Note that the current version if 15.03. Perhaps some of the updates would affect your design?

                      • 8. Re: Hide portal.

                        I'm asking the community after having checked with debugger as there are no errors: data from portal correctly transferred to fields on the left side (in pic2 I choose the first record and you can see the the data in the fourth field left and as the first two characters in the 8th field left.

                        There's a conditional formatting of the fields but the formula result is "not true" for all the records in the portal.


                        In the meantime I've tested excluding active portal row highlighting (blue border), but still the portal shows like in pic3 after choosing in pic2.


                        The layout is in a popover that has a onClosing Trigger checking if there's an open popover and inhibits the load of other layouts, etc. if so.

                        • 9. Re: Hide portal.

                          Hi and thanks.


                          I've checked the changes from .01 to .02 and .03 but did not see anything referred to this strange behaviour as the global variable in hide formula has same value in pic1 and pic3.

                          • 10. Re: Hide portal.

                            Please set up a small demo file that has this behavior and share it here so we can take a look at it.

                            • 11. Re: Hide portal.

                              The object just above the portal is hidden in picture 1 and 3.  Assign the same Hide Object that you have assigned to this object to the portal.  You do not need to hide the fields in the portal if the portal is hidden.

                              • 12. Re: Hide portal.

                                Hi and thanks to all!


                                Following screenshots of hide conditions and script steps (sorry it's in Italian).

                                $$modcod is set to "" unconditionally at top of script.


                                Hide condition 01:



                                Hide condition 02:



                                Script steps on popover load (button in 2nd pic, my 1st msg):



                                Script steps after click on record in portal:



                                Hope it's more clear.



                                • 13. Re: Hide portal.



                                  Just solved (after a hint from Giulio Villani in the Italian FileMaker Guru site):
                                  I inserted a "Save record" before "Refresh Window" in the second script part (4th picture of my last msg) and hiding is correct.


                                  FYI, popover is in a list format with automatic saving (?!?)


                                  Thanks for your time.