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.
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.
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?
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.
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?
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?
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.
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.
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"?
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.
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:
Here is the tab inactive panel:
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?
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"]
Go to Object [Object Name: Status Inactive]
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?