Found an odd bug today whilst enabling / disabling updatesEnabled on a check box. If the updates are enabled, the check box is checked in the script via .state() and then updates are disabled straight after, the entire checkbox disappears. You can try the following:
checkbox1.updatesEnabled(TRUE);
checkbox1.state(0, TRUE);
checkbox1.updatesEnabled(FALSE);
where checkbox1 is a single check box shape. If however there's a slight delay before disabling updates, it works fine:
checkbox1.updatesEnabled(TRUE);
checkbox1.state(0, TRUE);
delay(0, 10);
checkbox1.updatesEnabled(FALSE);
Any ideas why? using version 3.17 P010.
updatesEnabled ON / OFF causes shape to disappear
- tpjctrl
- Posts:145
- Joined: Tue May 08, 2018 10:30 am
updatesEnabled ON / OFF causes shape to disappear
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: updatesEnabled ON / OFF causes shape to disappear
I have tested it and I have seen the same behaviour.
Why it happens I could not detect and forwarded the information to our development team.
If you only want to modify the state of a single check box there is no need to use updatesEnabled TRUE/FALSE.
Best Regards
Leopold Knipp
Senior Support Specialist
Why it happens I could not detect and forwarded the information to our development team.
If you only want to modify the state of a single check box there is no need to use updatesEnabled TRUE/FALSE.
Best Regards
Leopold Knipp
Senior Support Specialist
- tpjctrl
- Posts:145
- Joined: Tue May 08, 2018 10:30 am
Re: updatesEnabled ON / OFF causes shape to disappear
Well at least something that's not just broken on my end 
The idea behind the updatesEnabled change was to allow a confirmation popup to show when the checkbox is clicked, but to not "tick" the checkbox until a yes is clicked on the popup. This basically means that updatesEnabled is FALSE pretty much all the time, until the checkbox is clicked, the action is confirmed via confirmation popup and then the checkbox can be updated and "ticked". Unfortunately due to the above bug I had to abandon this approach.
The idea behind the updatesEnabled change was to allow a confirmation popup to show when the checkbox is clicked, but to not "tick" the checkbox until a yes is clicked on the popup. This basically means that updatesEnabled is FALSE pretty much all the time, until the checkbox is clicked, the action is confirmed via confirmation popup and then the checkbox can be updated and "ticked". Unfortunately due to the above bug I had to abandon this approach.
- leoknipp
- Posts:2928
- Joined: Tue Aug 24, 2010 7:28 pm
Re: updatesEnabled ON / OFF causes shape to disappear
In that case you can use the option "enabled" instead of "updatesEnabled".
The idea of "updatesEnabled" is a different one to avoid flickering of objects while a lot of changes are made within script code.
Best Regards
Leopold Knipp
Senior Support Specialist
The idea of "updatesEnabled" is a different one to avoid flickering of objects while a lot of changes are made within script code.
Best Regards
Leopold Knipp
Senior Support Specialist
- tpjctrl
- Posts:145
- Joined: Tue May 08, 2018 10:30 am
Re: updatesEnabled ON / OFF causes shape to disappear
Well "enabled" isn't ideal either as it "blanks out" the entire check box, so it looks like it's not available for a click (besides, another piece of code handles the enabled bit to make it available only in a certain scenario). I do realise this was an odd way to use "updatesEnabled", but it would've worked if it wasn't for the buggy behavior.