代码:
<ui:repeat var="obj" value="#{demo2Bean.someList}">
<h:panelGroup id="foo" />
<h:dataTable id="bar" />
</ui:repeat>
结果:
<span id="j_idt55:0:foo"></span>
<table id="j_idt55:0:bar"><tbody><tr><td></td></tr></tbody></table>
<span id="j_idt55:1:foo"></span>
<table id="j_idt55:0:bar"><tbody><tr><td></td></tr></tbody></table>
正如您所看到的,数据表的id与'j_idt55:0:bar'相同,但对于panelGroups,它增长(应该如此):'j_idt55:0:foo','j_idt55:1:foo'。为什么会这样?