webtier@glassfish.java.net

Problem with CheckboxRenderer in 1.2_12

From: <webtier_at_javadesktop.org>
Date: Tue, 12 May 2009 04:07:17 PDT

Hi,

I'm developing an application with JSF using Mojarra 1.2_12.

Recently I noticed a bug with my check boxes. When there is component in the form that performs FacesContext.getCurrentInstance().renderResponse() within its ValueChangeListener method (immediate=true,onchange=submit), each check box is cleared. Other components such as text area keep their value before the submit.

I found the tree of changes of CheckboxRenderer.java:
http://fisheye5.atlassian.com/browse/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/CheckboxRenderer.java

and a change that in my opinion is responsible for the problem:
http://fisheye5.atlassian.com/browse/javaserverfaces-sources/jsf-ri/src/com/sun/faces/renderkit/html_basic/CheckboxRenderer.java?r1=1.84.4.1&r2=1.84.4.2

The code for writing "checked" to the html is modified from:
if ("true".equals(currentValue)) {

to
if (((UISelectBoolean) component).isSelected()) {

There should be some reason behind the new code but in the case of submit/renderResponse it introduces a bug. I have added the old code as a custom renderer and have overridden the one that comes with 1.2_12, my code is ok now.

Is there anyone who has any idea what is the purpose of the change and what should be the correct usage?
[Message sent by forum member 'wise_guybg' (wise_guybg)]

http://forums.java.net/jive/thread.jspa?messageID=345907