You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@tapestry.apache.org by Andy Chu <an...@gmail.com> on 2005/09/07 03:46:30 UTC
How to keep the scroll position of a page ?
Dear All,
Suppose now there is a form in the middle of a page. A user should scroll
down to the form and fill it in. When he/she submitted the form, the system
will redirect the same page with some response near the form to him/her.
Because the browser receive a new page, it renders the page again. The user
should scroll down again and see the form.
My question is :
Is it possible keep the scroll bar position when the form is submitted and
scroll to the position where it is submitted before ?
Thank you very much.
Best wishes,
Andy
--
我是天空裡的一片雲
偶爾投影在妳的波心
----偶然.徐志摩
Re: How to keep the scroll position of a page ?
Posted by Geoff Longman <gl...@gmail.com>.
Look at the Tacos tree component. It uses javascript to remember the
scroll position in the y axis and more javascript to ensure the page
is scrolled bakc to that position.
Geoff
On 9/6/05, Dr Paul Gorman <dr...@gmail.com> wrote:
> Yes it is :-)
>
> I implemented this using the default behaviour of a browser that moves focus
> to an anchor when it is the target URL for a form.
> When the submit button is pressed, the button's unique id is passed to a
> JavaScript function which changes the form action URL to include the id as
> an anchor.
>
> I wrap every button in the page with an id so the focus moves to it when the
> form is displayed again.
>
> Regards
>
> Paul.
>
>
> On 9/7/05, Andy Chu <an...@gmail.com> wrote:
> >
> > Dear All,
> >
> > Suppose now there is a form in the middle of a page. A user should scroll
> > down to the form and fill it in. When he/she submitted the form, the
> > system
> > will redirect the same page with some response near the form to him/her.
> > Because the browser receive a new page, it renders the page again. The
> > user
> > should scroll down again and see the form.
> >
> > My question is :
> > Is it possible keep the scroll bar position when the form is submitted and
> > scroll to the position where it is submitted before ?
> >
> > Thank you very much.
> > Best wishes,
> > Andy
> >
> > --
> > 我是天空裡的一片雲
> > 偶爾投影在妳的波心
> >
> > ----偶然.徐志摩
> >
>
--
The Spindle guy. http://spindle.sf.net
Get help with Spindle:
http://lists.sourceforge.net/mailman/listinfo/spindle-user
Announcement Feed:
http://www.jroller.com/rss/glongman?catname=/Announcements
Feature Updates: http://spindle.sf.net/updates
Re: How to keep the scroll position of a page ?
Posted by Dr Paul Gorman <dr...@gmail.com>.
Yes it is :-)
I implemented this using the default behaviour of a browser that moves focus
to an anchor when it is the target URL for a form.
When the submit button is pressed, the button's unique id is passed to a
JavaScript function which changes the form action URL to include the id as
an anchor.
I wrap every button in the page with an id so the focus moves to it when the
form is displayed again.
Regards
Paul.
On 9/7/05, Andy Chu <an...@gmail.com> wrote:
>
> Dear All,
>
> Suppose now there is a form in the middle of a page. A user should scroll
> down to the form and fill it in. When he/she submitted the form, the
> system
> will redirect the same page with some response near the form to him/her.
> Because the browser receive a new page, it renders the page again. The
> user
> should scroll down again and see the form.
>
> My question is :
> Is it possible keep the scroll bar position when the form is submitted and
> scroll to the position where it is submitted before ?
>
> Thank you very much.
> Best wishes,
> Andy
>
> --
> 我是天空裡的一片雲
> 偶爾投影在妳的波心
>
> ----偶然.徐志摩
>