Tony,
I'm not sure if you can mess with the URL (e.g. append a #errors) from
within Wicket without causing a redirect (and loosing your errors from the
request and form state) -- someone smarter than me can address that -- but
if you wanted to get creative, maybe in the onError handler your can
contribute a behavior of some 'window.onload' JavaScript to the body of the
page that does a 'window.location=#errors' or somethig like
that, so as soon as the page comes back up, the JS "redirects" to the exact
same page but an anchor on it.
Not sure if that would cause a redirect or not...
-R
On Fri, Feb 12, 2010 at 10:26 AM, Tony Wu wrote:
> Is there a way in Wicket for Button form onSubmit to refresh the page and
> scroll to a particular anchor? For example if I have 3 separate forms with
> a
> FeedbackPanel in each, if I click the submit button for the final form and
> there's a validation error, when the page refreshes the error messages are
> at the bottom. It's not apparent to the user anything happened unless they
> manually scroll down. It would be great if there's a way to scroll to
> href="#someanchor". I think there's a setAnchor function in wicket, but
> that's only for Links. Is there anything that works for Buttons/Form
> submission?
>