Details
Description
See Bug Report here:
https://github.com/primefaces-extensions/primefaces-extensions/issues/517
See comment here for root cause: https://github.com/primefaces-extensions/primefaces-extensions/issues/517#issuecomment-1688911766
I saw we had a id counter and it starts at 0 before the state is stored. So when the script is added, it's always using the same counter. [ See here.|https://github.com/apache/myfaces/blob/304099d4588383424df9105d5a751911c1c5301a/api/src/main/java/jakarta/faces/component/UIViewRoot.java#L493-L495]I think the main issue is that we aren't adding ids to the nested items here: https://github.com/apache/myfaces/blob/304099d4588383424df9105d5a751911c1c5301a/api/src/main/java/jakarta/faces/component/UIViewRoot.java#L218-L224
{{We need to look at the children and also assign IDs. }}
Only issue I see above is that I search only the immediate children and don't drill down any further. Otherwise, it seems to fix the duplicate id exception