当我通过ah:selectOneRadio上的Richfaces(3.3.3)的a4j:support执行reRender时,我的行为很奇怪(并非每次都如此)。
这是我的带有h:selectOneRadio的xhtml部分:
<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" />
当我进入浏览器时,我得到以下html代码:
<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>
一切都好。
但是,当此组件由另一个组件重新渲染时,html会更改,并且第一个单选元素不在表格中:
<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>
这是一个非常奇怪的行为,它破坏了我的风格。
为什么reRender破坏了html代码?
谢谢。
经过多次搜索,该错误来自neko。
为了优化性能,我更改了neko的xml解析(默认情况下为小),这可以破坏html。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句