Skip to content

Commit

Permalink
MYFACES-4631 (#614)
Browse files Browse the repository at this point in the history
  • Loading branch information
volosied authored Oct 17, 2023
1 parent 16a2cf1 commit e2f5217
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions api/src/main/java/jakarta/faces/component/UIViewRoot.java
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,18 @@ public void addComponentResource(FacesContext context, UIComponent componentReso
// https://issues.apache.org/jira/browse/MYFACES-2775
componentId = createUniqueId(context, null);
componentResource.setId(componentId);
List<UIComponent> children = componentResource.getChildren();

/*
* MYFACES-4631
* Duplicate ID Exception can occur if children also aren't assigned unique IDs
* See https://github.com/primefaces-extensions/primefaces-extensions/issues/517
*/
for(UIComponent child : children) {
String childId = createUniqueId(context, null);
child.setId(childId);
// TODO - Should we nest down further?
}
}

// This var helps to handle the case when we try to add a component that already is
Expand Down

0 comments on commit e2f5217

Please sign in to comment.