When a checkbox is created in addCheckBox() the variable is read in case it has been previously set and is compared against boolean values instead of the spec values. This creates a situation where the checkbox does not represent the variable state.
For example, if I use 1 and 0 for true and false, and preset the variable to 1; the checkbox will render as unchecked because the spec "set" value is ignored and the variable value used. Since the variable value is not boolean, it will always evaluate to false.
install.xml
<variables>
<variable name="the.variable" value="1"/>
</variables>
userInputSpec.xml
<field type="check" align="left" variable="the.variable">
<spec txt=" Set Me" true="1" false="0" set="true"/>
</field>
Made the following change in UserInputPanel, will commit if there are no objections:
if (value != null)
{ set = value; }Changed to:
if (value != null)
{
// Default is not checked so we only need to check for true
if (value.equals(trueValue)) { set = TRUE; }
}