UIData: do not limit children to be UIColumn only
- Dominant language
- Java
- Stars
- 127
- Forks
- 59
- Avg merge
- 23h
- Merged PRs (30d)
- 7
Description
According to the spec:
> 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`:
```java
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)
WDYT?
Contributor guide
Research direction
Start by reading UIData's child-visiting behavior and the related Jakarta Faces issue 1837. Compare the spec's UIColumn-only rule with the proposed isEligibleChildren hook and nested UIData traversal. Done means the specification and UIData behavior clearly define supported child types and row-state handling, with compatibility expectations recorded.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- java
- Domain
- frontend, web-dev
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100