In Flex, how do I create a CheckBox that can't be un-checked? I run a function when the checkbox is clicked. If that function encounters an error, I want the state of the checkbox to remain the same. How do I do that?
+2
A:
You can use the enabled
attribute to prevent the checkbox from being accessed once it's in the state you mentioned.
onFunctionError():void {
yourCheckbox.enabled = false;
}
bedwyr
2010-04-01 15:26:19
+1: N.B. You can also change the checked state of the checkbox programatically even while the checkbox is disabled.
Robusto
2010-04-01 17:13:03