Search code examples
jsfrichfacesjsf-1.2

JSF (1.2) bug when reRender h:selectOneRadio


When I do a reRender via a4j:support of Richfaces (3.3.3) on a h:selectOneRadio, I have a strange behavior (not every time).

Here is my xhtml section with the h:selectOneRadio:

<h:selectOneRadio id="toto" value="#controller.toto}" >
   <f:selectItem itemLabel="#{bundle['oui']}"
   itemValue="#{true}" />
   <f:selectItem itemLabel="#{bundle['non']}"
   itemValue="#{false}" />
</h:selectOneRadio>
<rich:message for="toto" />

When I go in a browser I get this html code:

<table id="formulaire:toto" >
<tbody>
<tr>
<td>
<input id="formulaire:toto:0" type="radio" onchange="A4J.AJAX.Submit('formulaire',event,{'control':this,'similarityGroupingId':'formulaire:support','parameters':{'ajaxSingle':'formulaire:toto','formulaire:support':'formulaire:support'} } )" value="true" name="formulaire:toto">
<label for="formulaire:toto:0"> oui</label>
</td>
<td>
<input id="formulaire:toto:1" type="radio" onchange="A4J.AJAX.Submit('formulaire',event,{'control':this,'similarityGroupingId':'formulaire:support','parameters':{'ajaxSingle':'formulaire:toto','formulaire:support':'formulaire:support'} } )" value="false" name="formulaire:toto" checked="checked">
<label for="formulaire:toto:1"> non</label>
</td>
</tr>
</tbody>
</table>

Everything is fine.

But when this one is reRender by another component, the html changes and the first radio element is out of the table:

<input type="radio" onchange="A4J.AJAX.Submit('formulaire',event,{'control':this,'similarityGroupingId':'formulaire:support','parameters':{'ajaxSingle':'formulaire:toto','formulaire:support':'formulaire:support'} } )" value="true" id="formulaire:toto:0" name="formulaire:toto" checked="checked">
<label for="formulaire:toto:0"> oui</label>
<table id="formulaire:toto">
<tbody>
<tr>
<td>
    <input type="radio" onchange="A4J.AJAX.Submit('formulaire',event,{'control':this,'similarityGroupingId':'formulaire:support','parameters':{'ajaxSingle':'formulaire:toto','formulaire:support':'formulaire:support'} } )" value="false" id="formulaire:toto:1" name="formulaire:toto"><label for="formulaire:toto:1"> non</label>
</td>
</tr>
</tbody>
</table>

It's a very strange behavior and it breaks my style.

Why the reRender breaks the html code ?

Thanks.


Solution

  • After many searchs, the bug comes from neko.

    To optimize performances, I change the xml parse (tiny by default) by neko and this one can break the html.