You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@myfaces.apache.org by Heath Borders <he...@gmail.com> on 2004/12/30 17:32:46 UTC

UISelectOne/UISelectMany and onchange

For components that render radio buttons and checkboxes, using the
onchange event is misleading.  If you put an onchange event on a radio
button or a checkbox, nothing happens when you check or uncheck the
radio/box.

According to the W3C HTML 4.01 spec:

"The onchange event occurs when a control loses the input focus and
its value has been modified since gaining focus. This attribute
applies to the following elements"

This does not happen when you select a radio/box.

I propose we do something to warn users about this behavior.  In the
most extreme case, we could just remove the onchange attribute from
elements that render radio buttons and checkboxes.  In the most
conservative case, we could just issue a log warning about using
onchange with renderers that render radio buttons and checkboxes.  Or
in the middle, we could warn the user and silently switch their
onchange events to onclick events and have this disabled/enabled with
a web.xml parameter.

thoughts?

-- 
-Heath Borders-Wing
hborders@mail.win.org