Hello,
I have an h:selectOneRadio like below and the listener from f:ajax isn't working.
<h:selectOneRadio value="#{clienteBean.cliente.tpSexo}">
<f:selectItem itemValue="M" itemLabel="#{msgs.masculino}"/>
<f:selectItem itemValue="F" itemLabel="#{msgs.feminino}"/>
<f:ajax listener="#{clienteBean.carregarTiposCumprimento}" render="tipoCumprimento"/>
</h:selectOneRadio>
After some debug in the JSF 2.0.2 source code, I found the problem:
In the method "decodeBehaviors" of "HtmlBasicRenderer" class is checked if the cliendId of the sender is the same of the behavior:
if (null != behaviorSource && behaviorSource.equals(clientId)) {
for (ClientBehavior behavior: behaviorsForEvent) {
behavior.decode(context, component);
}
}
But, in case of selectOneRadio, if the clientId of the component is: "form:radio". Then it's options clientId's will be "form:radio:0", "form:radio:1", "form:radio:2"...
In this case, the verification executed by the "decodeBehaviors" method, will be always "false" and the listener will be never executed, because the sender of the event is the "option" and the component decoded is the "selectOneRadio".
Anybody had the same problem? I'm doing something wrong? Or it's a bug?
Thanks
[Message sent by forum member 'rbsrodrigues']
http://forums.java.net/jive/thread.jspa?messageID=481111