Uploaded image for project: 'MyFaces Core'
  1. MyFaces Core
  2. MYFACES-4631

DuplicateIdException via addComponentResource

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 2.3.10, 3.0.2, 2.3-next-M8, 4.0.1
    • 4.0.2, 4.1.0-RC1
    • None
    • None

    Description

      See Bug Report here:

      https://github.com/primefaces-extensions/primefaces-extensions/issues/517

       

      https://github.com/omnifaces/omnifaces/wiki/Combine-hardcoded-PrimeFaces-resources-using-CombinedResourceHandler

       

      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

      Attachments

        Activity

          People

            Unassigned Unassigned
            volosied Volodymyr Siedlecki
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: