Wicket
  1. Wicket
  2. WICKET-5085

InlineEnclosure are piling up on each render

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 6.6.0, 1.5.10
    • Fix Version/s: 6.7.0, 1.5.11
    • Component/s: wicket
    • Labels:
      None

      Description

      InlineEnclosureHandler#resolve() uses an auto-incremented id for its resolved InlineEnclosure,

      On the next render, a new instance will be resolved, since the id of the already resolved InlineEnclosure does not match the id in the markup.

      But InlineEnclosures are not removed after render as other auto-components, thus all instances pile up in the owning container of the markup.

        Issue Links

          Activity

          Hide
          Sven Meier added a comment -

          id of enclosure is now stable in markup

          Show
          Sven Meier added a comment - id of enclosure is now stable in markup
          Hide
          Martin Grigorov added a comment -

          There is still problem with unique id of InlineEnclosures.
          The introduced counter is field member of InlineEnclosureHandler but IMarkupFilter instances are not shared between markup files. I.e. MyPanelA will use instance of InlineEnclosureHandler and MyPanelB will use another instance of InlineEnclosureHandler. So their produced markup will have unique 'counter' by its own, but the counters will collide in the final page markup.

          Show
          Martin Grigorov added a comment - There is still problem with unique id of InlineEnclosures. The introduced counter is field member of InlineEnclosureHandler but IMarkupFilter instances are not shared between markup files. I.e. MyPanelA will use instance of InlineEnclosureHandler and MyPanelB will use another instance of InlineEnclosureHandler. So their produced markup will have unique 'counter' by its own, but the counters will collide in the final page markup.
          Hide
          Martin Grigorov added a comment -

          The problem is even deeper.
          The problem with the many instances of InlineEnclosureHandler is easily solved by making the 'counter' variable static.

          But there is still a problem when PanelA is repeated in Wicket repeater. In this case the produced markup for all renderings of PanelA have the same HTML ids.

          Show
          Martin Grigorov added a comment - The problem is even deeper. The problem with the many instances of InlineEnclosureHandler is easily solved by making the 'counter' variable static. But there is still a problem when PanelA is repeated in Wicket repeater. In this case the produced markup for all renderings of PanelA have the same HTML ids.
          Hide
          Sven Meier added a comment -

          Why not let InlineEnclosure use Wicket's standard HTML id generation? That would be far easier than introducing yet another complexity in handling of enclosures:

          diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/InlineEnclosure.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/InlineEnclosure.java
          index 3e4d230..d0d16ba 100644
          — a/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/InlineEnclosure.java
          +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/InlineEnclosure.java
          @@ -58,7 +58,6 @@

          // ensure that the Enclosure is ready for ajax updates
          setOutputMarkupPlaceholderTag(true);

          • setMarkupId(getId());
            }

          @Override

          IMHO this problem would better tracked on a separate issue. What's the fix version now?

          Show
          Sven Meier added a comment - Why not let InlineEnclosure use Wicket's standard HTML id generation? That would be far easier than introducing yet another complexity in handling of enclosures: diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/InlineEnclosure.java b/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/InlineEnclosure.java index 3e4d230..d0d16ba 100644 — a/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/InlineEnclosure.java +++ b/wicket-core/src/main/java/org/apache/wicket/markup/html/internal/InlineEnclosure.java @@ -58,7 +58,6 @@ // ensure that the Enclosure is ready for ajax updates setOutputMarkupPlaceholderTag(true); setMarkupId(getId()); } @Override IMHO this problem would better tracked on a separate issue. What's the fix version now?
          Hide
          Martin Grigorov added a comment -

          WICKET-5162 will provide the fix for 6.8.0, 1.5.11

          Show
          Martin Grigorov added a comment - WICKET-5162 will provide the fix for 6.8.0, 1.5.11

            People

            • Assignee:
              Martin Grigorov
              Reporter:
              Sven Meier
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development