Bug: Cannot Clear Radio Button List Selection
Description
Normally, setting a field’s rawValue property to null essentially clears its value. It should follow that setting a radio button list’s rawValue property would clear its selection (i.e. if one of its radio buttons was selected, none would be selected when its value is set to null).
To clear a text field, for example, you would do the following:
MyTextField.rawValue = null;
To clear a radio button list, the following should also work:
MyRadioButtonList.rawValue = null;
The issue is that the above statement for clearing a radio button list doesn’t work: The selection remains and the radio button list’s rawValue property remains set to the value of the selected radio button.
Workaround
There are two workarounds to this issue. The first consists of clearing the data node associated with the radio button list, provided the radio button list is bound to data (which means the “Object palette > Binding tab > Default Binding property” is set to something other than “None”):
MyRadioButtonList.dataNode.isNull = 1;
Note that if you attempt to use this workaround when the radio button list is not bound to data, an error will occur because its dataNode property will be null and you’ll attempt to access the isNull property of a null object.
The second workaround consists of using the xfa.host.resetData() method to clear the radio button list:
xfa.host.resetData(MyRadioButtonList.somExpression);
The advantage of the second workaround is that it will work regardless of whether the radio button list has a data binding or not.
Fix
Please refer to the Bug List for updated information on the version(s) affected by this bug as well as if and when it was/will be fixed.
Posted by Stefan Cameron on October 9th, 2008
Filed under Acrobat,Bugs,Scripting,XFA