为什么h:dataTable不在ui中:重复获取正确的ID? [英] Why doesn't h:dataTable inside ui:repeat get correct ID?
本文介绍了为什么h:dataTable不在ui中:重复获取正确的ID?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
代码:
<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'。为什么会这样?
As you can see, the id for datatables is the same 'j_idt55:0:bar' but for panelGroups it grows (as should): 'j_idt55:0:foo', 'j_idt55:1:foo'. Why is it so?
推荐答案
因为它是 UIData#getClientId()
。我已将其报告为 issue 1830 。
这篇关于为什么h:dataTable不在ui中:重复获取正确的ID?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文