1 2 Previous Next 16 Replies Latest reply on Aug 7, 2013 12:12 AM by Beowulf

    hiding tab control with script

    Beowulf

      Title

      hiding tab control with script

      Post

           Hi,

           I checked the forum but couldn't find this specific question. I'm using FM Pro 12.0v4 on Windows 7.

           I guess there is a simple answer to it but I'm new to FM, so bear with me. :)

           There is a little tutorial from seedcode on the web about this topic: http://www.seedcode.com/filemaker-12-layout-tricks-hiding-tabs/ and I could follow it until step 4. There I have the problem that when I do the second line of the script "Exit Script [Result: 0]" I get an error message "The specified table cannot be found". I don't know if this has anything to do with the comment at the end of step 4 "Don't forget that result = 0 in the exit script line". But then I don't get what he means by that since  "Result: 0" is written in the script.

           Thanks for any help. :)

        • 1. Re: hiding tab control with script
          philmodjunk

               In the dialog, be sure to enter just the value 0. Do not enter "Result: 0". The "Result:" tag is supplied automatically by the script editor.

          • 2. Re: hiding tab control with script
            Beowulf

                 Thanks for the quick answer PhilModJunk! smiley

                 I have now done all the 5 steps of the tutorial but unfortunately the content of the tab does not disappear in Browse mode. So, the Tab is invisible in Browse Mode but the field which is inside the Tab is visible (the"Dead field"), see picture. I checked the "OnTabSwitch" and "enable in: Browse". In the "Specify Script" Window I selected the script "DisableTabControl" and in the "Optional script parameter" field I wrote "Get (ScriptName)".

                 The tab is completely inside the field, because I read that can also be an issue. And I put the field inside the tab with the "field tool". But I guess that doesn't matter, I mean you could just drag an already existing field inside the tab, right?

                 Any ideas why it doesn't work?

                 In the end what I would like to have is the following:

                 The tab control stays invisible until I change the "status" field from "active" to "inactive" whereas the "Dead" field becomes visible and I can enter either "No", "Yes" or "Unknown". How do I achieve that?

                 P.S. What you see on the picture is just a test database, that is why some fields are empty.

                  

            • 3. Re: hiding tab control with script
              philmodjunk

                   Yes, but I can't see the tab control. One common source of trouble for tab controls is that they fail to work as expected if part of the control touches are crosses the boundary between two layout parts. Could that be the case here?

              • 4. Re: hiding tab control with script
                Beowulf

                     No, it doesn't. Here is a pic of the tab in layout mode. But I don't know what this little icon on the right side lower corner means of the tab rectangle.

                • 5. Re: hiding tab control with script
                  philmodjunk

                       That indicatest that you have a script trigger specified for the tab control. Usually, haven't read the link, using a tab control to hide a field requires that you have two tab panels, one with the field and one without. Do you have two panels in this control or only one?

                  • 6. Re: hiding tab control with script
                    Beowulf

                         I have only one but I also tried it with two tabs and then the one is visible which I last clicked on in layout mode.

                         Or is the general idea of it that you have one tab with nothing in it and that's how you can hide the tab?

                    • 7. Re: hiding tab control with script
                      SteveMartino

                           I had a similar problem, but I cant remember how I fixed it (yikes!).  I think I moved the tab off the screen, moved all the fields out of the way, pulled the tab panel back in, and dragged all the fields back in, making sure, like Phil said, they were totally contained in the tab panel.  Or if this is just a sample DB, put a link on Dropbox, and I, and/or maybe someone else, will fuddle around with it.

                      • 8. Re: hiding tab control with script
                        philmodjunk

                             See this demo file for hiding objects on a layout. Using a tab control is one of the methods in the file. One panel is empty and the other contains several layout objects. A script is used with go to object to select a specific panel in the tab control to reveal or hide the objects by selecting the correct tab panel.

                        https://www.dropbox.com/s/8levaz6deiyzjr8/LayoutObjectVisibilityControlDemo.fp7

                        • 9. Re: hiding tab control with script
                          Beowulf

                               Thanks for this Demo. I tried now your third version "A transparent tab control with a script can be used to control visibility" but unfortunately it still doesn't work, meaning the tab remains hidden.

                               First to make sure, you write that one trigger is "OnObjectChange" but I couldn't find this command instead there is "OnObjectModify" is that the same?

                               What I changed is how to let the tabs vanish, so they only vanish in browse mode but are still visible in layout mode. I did it as specified in this little tutorial: Conditional formatting of the tab control with the calculation "Get (WindowMode)  ≠ 4" and the text size of 300pt. I also tried it with your version "fixed width of 0" and it didn't work. So I don't think that is at fault here.

                               What I did was the following (when you look at my table birds), when a new record is created the status is automatically set to active. When the status is changed to inactive then the tab control should get visible. My status field is a radio button set but it also didn't work when I changed the field to a checkbox set like in your Demo. Also disabling the function to automatically setting the status to active didn't help.My Dead field in the tab control is a radio button set but I imagine what type of field is in the tab control doesn't matter. Anyway I changed that too and it didn't help.

                               Any other idea why the doesn't get visible when I change the Status from "active" to "inactive"?

                          • 10. Re: hiding tab control with script
                            philmodjunk

                                 Yes, I meant OnObjectModify. I Still only see one tab panel. You need two, one that contains your layout objects that you want to make disappear and one tab panel that is empty. Each tab panel needs an object name supplied in the name box on the inspector's position tab and scripts have to detect the needed modification and then use go to object to pop the appropriate tab panel to the front to make the objects appear or disappear.

                            • 11. Re: hiding tab control with script
                              Beowulf

                                   But I have two tabs or are we not talking about the same? I also named each tab pannel with the inspector. I made lines and fills again to make it visible.

                                   Here is the tab active panel:

                              • 12. Re: hiding tab control with script
                                Beowulf

                                     Here is the tab inactive panel:

                                • 13. Re: hiding tab control with script
                                  philmodjunk

                                       And those are the first screen shots where I can see that you have two tab panels.

                                       And have you set up a script that is performed by a script trigger that uses Go To Object to select the correct tab panel?

                                       I can see a script trigger icon in your layout. What are the exact steps of your script?

                                  • 14. Re: hiding tab control with script
                                    Beowulf

                                         Sorry about that.

                                         Yes, script trigger: On the field "status", checked is "OnObjectModify", enable in "Browse" and the script steps are the following ones:

                                         If [not Birds::Status]

                                            Go to Object [Object Name: "Status Active"]

                                         Else

                                            Go to Object [Object Name: Status Inactive]

                                         End if

                                         And the other script: "Manage layout" -> "Birds" -> "Script Trigger" checked "OnRecordLoad" with the same script again and "enabled in": Browse

                                         Maybe there's a problem because I have a radio button set on not just one checkbox field?

                                    1 2 Previous Next