You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by mg...@apache.org on 2013/04/28 13:56:39 UTC
git commit: WICKET-5085 InlineEnclosure are piling up on each render
Updated Branches:
refs/heads/master 681ac4e2c -> b26284d27
WICKET-5085 InlineEnclosure are piling up on each render
Use the loopitem index when creating an id for InlineEnclosure in repeater
Project: http://git-wip-us.apache.org/repos/asf/wicket/repo
Commit: http://git-wip-us.apache.org/repos/asf/wicket/commit/b26284d2
Tree: http://git-wip-us.apache.org/repos/asf/wicket/tree/b26284d2
Diff: http://git-wip-us.apache.org/repos/asf/wicket/diff/b26284d2
Branch: refs/heads/master
Commit: b26284d272ff627d0521fa31f8a69f2e8d9338c2
Parents: 681ac4e
Author: Martin Tzvetanov Grigorov <mg...@apache.org>
Authored: Sun Apr 28 13:55:32 2013 +0200
Committer: Martin Tzvetanov Grigorov <mg...@apache.org>
Committed: Sun Apr 28 13:55:32 2013 +0200
----------------------------------------------------------------------
.../parser/filter/InlineEnclosureHandler.java | 10 ++++++++--
1 files changed, 8 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/wicket/blob/b26284d2/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/InlineEnclosureHandler.java
----------------------------------------------------------------------
diff --git a/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/InlineEnclosureHandler.java b/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/InlineEnclosureHandler.java
index 507339b..181c91d 100644
--- a/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/InlineEnclosureHandler.java
+++ b/wicket-core/src/main/java/org/apache/wicket/markup/parser/filter/InlineEnclosureHandler.java
@@ -27,6 +27,7 @@ import org.apache.wicket.markup.MarkupResourceStream;
import org.apache.wicket.markup.MarkupStream;
import org.apache.wicket.markup.WicketTag;
import org.apache.wicket.markup.html.internal.InlineEnclosure;
+import org.apache.wicket.markup.html.list.LoopItem;
import org.apache.wicket.markup.parser.AbstractMarkupFilter;
import org.apache.wicket.markup.resolver.IComponentResolver;
import org.apache.wicket.util.string.Strings;
@@ -65,10 +66,10 @@ public final class InlineEnclosureHandler extends AbstractMarkupFilter
private Stack<ComponentTag> enclosures;
/**
- * InlinceEnclosures are not removed after render as other auto-components,
+ * InlineEnclosures are not removed after render as other auto-components,
* thus they have to have a stable id.
*/
- private int counter;
+ private static int counter;
/**
* Construct.
@@ -205,6 +206,11 @@ public final class InlineEnclosureHandler extends AbstractMarkupFilter
if (Strings.isEmpty(inlineEnclosureChildId) == false)
{
String id = tag.getId();
+ if (container instanceof LoopItem)
+ {
+ LoopItem item = (LoopItem) container;
+ id = id + '_' + item.getIndex();
+ }
// Yes, we handled the tag
return new InlineEnclosure(id, inlineEnclosureChildId);