facelets
  1. facelets
  2. FACELETS-360

c:forEach: duplicated ID when component removed and then added back

    Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.1.14
    • Fix Version/s: 1.1.15
    • Component/s: impl
    • Labels:
      None
    • Environment:

      Operating System: All
      Platform: All

    • Issuezilla Id:
      360

      Description

      The issue originally not related to id's I just simplified https://
      jira.jboss.org/jira/browse/RF-7962 case.

      Test case war attached.

      Related Code
      <h:form>
      <h:inputText value="#

      {bean.number}

      " />
      <h:commandButton value="Add" action="#

      {bean.add}

      "/>
      <h:commandButton value="Remove" action="#

      {bean.remove}

      "/>
      </h:form>
      <h:panelGrid>
      <c:forEach items="#

      {bean.tabs}

      " var="number">
      <h:outputText id="tab#

      {number}" value="#{number}

      " />
      </c:forEach>
      </h:panelGrid>
      Bean contains ArrayList of Strings. We removing String "2". And getting "1" and
      "3" fine rendered. BUT: <ui:debug/> shows us that there are still three
      outputText components in tree. And after we trying to add "2" back - duplicated
      id exception risen.
      If after removing but before adding we will refresh the page - this issue will
      not appears. Also the problem not reproduced if we removing last imtem from
      list instead of second.

      We investigated the case and found out that seems when forEach handler invoked
      on build view - component handler doesn't process last component because of the
      collection new length.

        Activity

        Hide
        ishaikovsky added a comment -

        Created an attachment (id=143)
        maven based source project

        Show
        ishaikovsky added a comment - Created an attachment (id=143) maven based source project
        Hide
        ishaikovsky added a comment -

        RF QE engineer added to CC.

        Show
        ishaikovsky added a comment - RF QE engineer added to CC.

          People

          • Assignee:
            Unassigned
            Reporter:
            ishaikovsky
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated: