Uploaded image for project: 'Wicket'
  1. Wicket
  2. WICKET-3972

wicket:message attribute results in "The component was rendered already" error

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 1.5-RC5.1
    • 1.5-RC6
    • wicket
    • None
    • Linux Ubuntu, Tomcat 6, Java 6

    Description

      Seems like there is a problem with generation of tag and component IDs when using wicket:message as an attribute for tags inside ListView.
      The quickstart webapp is attached to this ticket. There are two pages in this webapp: HomePage with a ListView containing tags with wicket:message attribute and two tags with wicket:message attribute outside the ListView. If a user goes to the next page (SecondPage) using the link on HomePage and then goes back to HomePage using the link on SecondPage, the exception mentioned in the subject occurs.
      Seems that the ID generation for tags and components is wrong: the ComponentTag-s are cached together with the corresponding Markup and then reused for later renderings. But the problem is, that those ComponentTag-s are mutable (at least in case of tags with wicket:message attribute) and their IDs are changed on every rendering and this produces ID conflicts when MarkupContainer.renderNext tries to find or create components corresponding to the tags.
      Interesting is, that we can reproduce this bug only in DEVELOPMENT mode. In DEPLOYMENT mode everything seems to work. The solution would be to make ComponentTags immutable and do not allow to change them, but to create copies (there is mutable method in ComponentTag, which is used in some cases).

      Attachments

        1. wicket-message-index.patch
          2 kB
          Peter Ertl
        2. quickstart.zip
          22 kB
          Sergiy Barlabanov

        Activity

          People

            jdonnerstag Juegen Donnerstag
            barlabanov Sergiy Barlabanov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: