Issue Details (XML | Word | Printable)

Key: IZPACK-66
Type: Bug Bug
Status: Closed Closed
Resolution: Fixed
Priority: Major Major
Assignee: Jeff Gordon
Reporter: Jeff Gordon
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
IzPack

UserInputPanel checkbox does not set properly

Created: 17/Apr/08 04:01 PM   Updated: 23/Apr/08 02:02 PM   Resolved: 21/Apr/08 07:42 PM
Return to search
Component/s: Panels
Affects Version/s: 3.11.0
Fix Version/s: 4.0.0

Time Tracking:
Not Specified


 Description  « Hide

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>



Jeff Gordon added a comment - 17/Apr/08 04:04 PM

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; }
}


Julien Ponge added a comment - 19/Apr/08 07:08 AM

You can go ahead for inclusion in 4.0.0.


Julien Ponge made changes - 19/Apr/08 03:36 PM
Field Original Value New Value
Fix Version/s 4.0.0 [ 14071 ]
Jeff Gordon added a comment - 21/Apr/08 07:42 PM

Committed as proposed.


Jeff Gordon made changes - 21/Apr/08 07:42 PM
Resolution Fixed [ 1 ]
Status Open [ 1 ] Resolved [ 5 ]
Julien Ponge added a comment - 23/Apr/08 02:02 PM

The issue is confirmed to be closed.


Julien Ponge made changes - 23/Apr/08 02:02 PM
Status Resolved [ 5 ] Closed [ 6 ]