History | Log In     View a printable version of the current page.  
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
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>



 All   Comments   Work Log   Change History      Sort Order: Ascending order - Click to sort in descending order
Jeff Gordon - 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 - 19/Apr/08 07:08 AM
You can go ahead for inclusion in 4.0.0.

Jeff Gordon - 21/Apr/08 07:42 PM
Committed as proposed.

Julien Ponge - 23/Apr/08 02:02 PM
The issue is confirmed to be closed.