简体   繁体   中英

Why doesn't h:dataTable inside ui:repeat get correct ID?

Code:

<ui:repeat var="obj" value="#{demo2Bean.someList}">
    <h:panelGroup id="foo" />
    <h:dataTable id="bar" />
</ui:repeat>

Result:

<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>

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?

Because it's a bug in UIData#getClientId() . I've reported it as issue 1830 .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM