Github user martin-g commented on a diff in the pull request:
https://github.com/apache/wicket/pull/260#discussion_r164051658
--- Diff:
wicket-core/src/main/java/org/apache/wicket/ajax/AbstractAjaxTimerBehavior.java
---
@@ -92,6 +95,35 @@ public void renderHead(Component component,
IHeaderResponse response)
}
}
+ /**
+ * Can be overridden to provide different implementation
+ *
+ * @return the unique ID of JS timer
+ */
+ protected CharSequence createTimerId()
+ {
+ StringBuilder jsId = new
StringBuilder(getComponent().getMarkupId());
+ List<AbstractAjaxTimerBehavior> list =
getComponent().getBehaviors(AbstractAjaxTimerBehavior.class);
+ if (list.size() != 1)
+ {
+ for (int i = 0; i < list.size(); ++i)
+ {
+ if (list.get(i) == this)
+ {
+ jsId.append('_').append(i);
--- End diff --
Maybe it will be better to use UUID or an id from the session (like the
page ids).
Using the behavior index might break when the application removes some
behavior and adds another.
If behavior index is used then you may want to use `break` here.
---