Refocus input field after page gets refreshed in wicket
<p>Is it somehow possible to refocus an input field after a refresh which was last focused before the page was requested?</p>

<p>I have a Wicket Form within my WebPage and in this Form there are quite some input fields (like text fields) the user can use to filter my data view. But when the user for example has the focus on the second input field and then clicks on 'go to next page' within the data view he loses the focus, but due to accessibility it is necessary to refocus the second input field.</p>

<p>My idea was to first tag the input field with jQuery with "regain-focus" when focused:</p>

<pre><code>$("input").focus(function() {
   $("input").removeAttr("regain-focus");
   $(this).attr("regain-focus", "regain-focus");
});
</code></pre>

<p>Then on server update search for the element with the "regain-focus" tag - <strong>but that's the part, I don't know how to do that...</strong> - tag the corresponding component with "autofocus":</p>

<pre><code>input.add(AttributeModifier.append("autofocus", "autofocus"));
</code></pre>

<p>and refocus with javascript:</p>

<pre><code>$('[autofocus]').focus();
</code></pre>