Only children of type UIColumn should be processed by renderers associated with this component.
But why stop there? When what makes this component quite powerful is the "saving state per row algorithm"... It's gonna be a repeat of https://github.com/jakartaee/faces/issues/1837, but in PrimeFaces we had to create a custom UIData to support other kind of children (like p:columns). Also, UIRepeat seem very similar to UIData and yet are two different component
IMO, the spec should "allow" UIData to have more children than just UIColumn so they can be processed. Also, it should handle cases where children is also UIData (that would solve this problem https://github.com/jakartaee/faces/issues/1837 I think).
As a quick example what it could look like in UIData:
private boolean visitColumnsAndColumnFacets(VisitContext context, VisitCallback callback, boolean visitRows) {
if (visitRows) {
setRowIndex(-1);
}
if (getChildCount() > 0) {
for (UIComponent column : getChildren()) {
if(column instanceof UIData) {
UIData child = (UIData) column;
for (int j = 0; j < child.getRowCount(); j++) {
child.setRowIndex(j);
boolean value = visitColumnFacets(context, callback, child);
if (value) {
child.setRowIndex(-1);
return true;
}
}
child.setRowIndex(-1);
}
else if (isEligibleChildren(column)) {
if (visitColumnFacets(context, callback, column)) {
return true;
}
}
}
}
return false;
}
Where UIData#isEligibleChildren() returns whether or not children should be visited/processed etc. (where this method is protected and can be overrided)
According to the spec:
But why stop there? When what makes this component quite powerful is the "saving state per row algorithm"... It's gonna be a repeat of https://github.com/jakartaee/faces/issues/1837, but in PrimeFaces we had to create a custom UIData to support other kind of children (like p:columns). Also, UIRepeat seem very similar to UIData and yet are two different component
IMO, the spec should "allow" UIData to have more children than just UIColumn so they can be processed. Also, it should handle cases where children is also UIData (that would solve this problem https://github.com/jakartaee/faces/issues/1837 I think).
As a quick example what it could look like in
UIData
:Where
UIData#isEligibleChildren()
returns whether or not children should be visited/processed etc. (where this method is protected and can be overrided)WDYT?