Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

java

jsf

jsf-2

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?

like image 547
Tuukka Mustonen Avatar asked Aug 03 '26 01:08

Tuukka Mustonen


1 Answers

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

like image 186
BalusC Avatar answered Aug 05 '26 14:08

BalusC



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!