From a36ed9f200429cc86ffe8b2134c42c49952a9e54 Mon Sep 17 00:00:00 2001 From: Sven Meier Date: Fri, 28 Jul 2023 22:51:06 +0200 Subject: [PATCH] WICKET-7065 replace inline js with header item --- .../html/repeater/data/table/filter/FilterForm.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/FilterForm.java b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/FilterForm.java index 48af754e9da..a3099c74556 100644 --- a/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/FilterForm.java +++ b/wicket-extensions/src/main/java/org/apache/wicket/extensions/markup/html/repeater/data/table/filter/FilterForm.java @@ -22,6 +22,7 @@ import org.apache.wicket.markup.MarkupStream; import org.apache.wicket.markup.head.IHeaderResponse; import org.apache.wicket.markup.head.JavaScriptHeaderItem; +import org.apache.wicket.markup.head.OnEventHeaderItem; import org.apache.wicket.markup.head.OnLoadHeaderItem; import org.apache.wicket.markup.html.form.Form; import org.apache.wicket.markup.html.form.FormComponent; @@ -140,11 +141,9 @@ public void bind(Component component) } @Override - public void onComponentTag(final Component component, final ComponentTag tag) - { - tag.put("onfocus", getFocusTrackingHandler(component)); - - super.onComponentTag(component, tag); + public void renderHead(Component component, IHeaderResponse response) { + response.render(OnEventHeaderItem.forComponent(component, "focus", + getFocusTrackingHandler(component))); } }); }