struts-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 19793] New: - Checkbox and nested tags between interaction
Date Fri, 09 May 2003 09:41:56 GMT
DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUG 
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19793>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED AND 
INSERTED IN THE BUG DATABASE.

http://nagoya.apache.org/bugzilla/show_bug.cgi?id=19793

Checkbox and nested tags between interaction

           Summary: Checkbox and nested tags between interaction
           Product: Struts
           Version: 1.1 RC1
          Platform: Other
        OS/Version: Other
            Status: NEW
          Severity: Major
          Priority: Other
         Component: Unknown
        AssignedTo: struts-dev@jakarta.apache.org
        ReportedBy: bengtson@withoutprice.com


There is a HTML bug using arrays of checkboxes... I have tested it with nested 
tags, but maybe can happens also with html tags. 

See the example below:

<nested:iterate name="FileFormatForm" property="arrayView" id="arrayView">
	<nested:checkbox property="enabled"/>
</nested:iterate>

{My Screen}

Checkbox 1 - Checked
Checkbox 2 - Checked
Checkbox 3 - Checked
Checkbox 4 - UnChecked
Checkbox 5 - Checked

When you have more than 1 item in the array (see the example), and you uncheck 
a checkbox that was checked (for example I uncheck the checkbox 2), after 
submit the form, the checkbox continues to be checked (on). 


To bypass the error:

Change your checkbox box getter in the ActionForm like this:

public String getEnabled() {
	String temp = enabled;
	// this is added because of a HTML bug / struts
	enabled = null;
	return temp;
}

PS: If you call the getter anywhere, make sure to reset the variable, eg:

....

String tempEnabled = getEnabled();
setEnabled(tempEnabled);

....

Now use your tempEnabled as you want...

---------------------------------------------------------------------
To unsubscribe, e-mail: struts-dev-unsubscribe@jakarta.apache.org
For additional commands, e-mail: struts-dev-help@jakarta.apache.org


Mime
View raw message