Re: Scroll to Anchor on Form Submit

2010-04-20 Thread Amorgos

Here is how you can do it. Have a look at this blog post:

http://androidisland.blogspot.com/2010/04/wicket-submitting-form-to-anchor.html
http://androidisland.blogspot.com/2010/04/wicket-submitting-form-to-anchor.html 
-- 
View this message in context: 
http://n4.nabble.com/Scroll-to-Anchor-on-Form-Submit-tp1843617p2017216.html
Sent from the Wicket - User mailing list archive at Nabble.com.

-
To unsubscribe, e-mail: users-unsubscr...@wicket.apache.org
For additional commands, e-mail: users-h...@wicket.apache.org



Scroll to Anchor on Form Submit

2010-02-12 Thread Tony Wu
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?


Re: Scroll to Anchor on Form Submit

2010-02-12 Thread Riyad Kalla
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=currentURL#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 e90t...@gmail.com 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?