sfpx Posted October 27, 2014 Posted October 27, 2014 I tried using "IsEmpty(Self)" as a condition in the Hide Object section of the object inspector but it does not work (it always hides). Am I missing something ? P.S. If you are wondering why I want to hide something that is actually empty it's simply to "disable" the button of this object. Of course I can use "IsEmpty(TableName::FieldName)" as the condition but certainly more painful when you have a lot of objects to hide .
Lee Smith Posted October 27, 2014 Posted October 27, 2014 Are you using 12 or 13? Hiding Layout Objects is new in 13.
sfpx Posted October 27, 2014 Author Posted October 27, 2014 Version 13 of course I also tried isempty(GetLayoutObjectAttribute(Self;"content")) No success
eos Posted October 27, 2014 Posted October 27, 2014 I tried using "IsEmpty(Self)" as a condition in the Hide Object section of the object inspector but it does not work (it always hides). Works for me. See attached. Version 13 of course That's not what your profile says … HideSelf_eos.fmp12.zip
Lee Smith Posted October 27, 2014 Posted October 27, 2014 Version 13 of course Well then ,update your profile so that the rest of us will know it too! Here is a quick link. MY PROFILE
sfpx Posted October 28, 2014 Author Posted October 28, 2014 Works for me. See attached. That's not what your profile says … I think there is a bug in filemaker with the Hide object condition. I noticed it a couple of times. The other day I had an object that had an hide condition that was not visible. In other words, the object was hiding correctly but the condition was not visible. And I know I had added it and it was actually working but the condition was not visible in the hide object calculation section. This time for this object (a container field) if I put "isempty(self)" in the hide condition it always hides the object even if it's not empty. BUT if I create a new object of the same exact field, the condition works as expected. It may be related to the fact that the field was previously from an external table occurrence but I just changed it for a field of the layout table. The problem is that I have literally hundreds of this kind of objects among many layouts , I don't want to delete all of them and recreated them. I just want them to point to another field and change the hide condition. Not sure I'm clear. I will try to reproduce it on a small database example.
sfpx Posted October 28, 2014 Author Posted October 28, 2014 (I changed my profile, sorry guys) Ok I copied my object inside a new database and it still is acting really weird. Look at the file attached. There are 2 objects, the 1st one is hiding correctly but the second one is not. Both objects are displaying the same field and have the exact same hide condition. (Edit the layout to see the second object because it's always hidden with the current condition...really strange thing) hide.fmp12.zip
sfpx Posted October 28, 2014 Author Posted October 28, 2014 Found the bug. If you remove the script associated with the button, the hide condition works. Note that on the attached example the script is missing but it is not missing in my project obviously. For the hide condition to work as expected I have to set the button to "Do nothing" and then reselect the script. That's definitely a bug . Not exactly sure how to reproduce it but I guess it has to do with changing the field of an object that has a button and an hide condition.
sfpx Posted October 28, 2014 Author Posted October 28, 2014 hmmmm It's really acting strange. Look at that The second object is hiding correctly. In design mode there is the "eye" icon on the second object to inform us that it has an hide condition but that condition is not visible. (Sorry for the size of the attachement, I was testing to see if it was related to the theme so I applied one randomly) P.S. If you remove the button of the second object, the hide condition reappears. Funny stuff. Conclusion: You have to set the hide condition of an object when it has no button. Once you selected your button script the hide condition will still work but it will not be visible in the inspector. Can anyone confirm that behavior ? hide part 2.fmp12.zip
sfpx Posted October 28, 2014 Author Posted October 28, 2014 I think I understand what's going on. When you add a button to a field object, Filemaker will add a button layer to your object. If you add an hide condition after you added a button layer, "Self' will refer to the button and not the field object. It's also why when you add the hide condition on the field object (i.e before adding the button layer by selecting a script) it disappears once you make the object a button . The inspector is showing you the hide condition of the button layer and not the field object. The field object hide condition is still there and effective but you don't see it in the inspector..It makes things a bit confusing IMO.
Recommended Posts
This topic is 3747 days old. Please don't post here. Open a new topic instead.
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now