Scrolling & live stuff (was Re: [Seaside] Re: [ShoreComponents]
WebTree, SVG demo and dynamic files)
radoslav hodnicak
rh at 4096.sk
Sat Jul 16 20:01:20 CEST 2005
On Fri, 15 Jul 2005, [ISO-8859-2] Jan B. Krejèí wrote:
>>> 3) a decorator allowing to preserve page scrolling coordinates between
>>> submits, so if you have scrolled 5 feet down to find the button you
>>> want to click, you will see the same page location after the response
>>> is loaded from server. I saw this in .NET and I like it very much.
Ok I created such decoration today. The code is trivial. It
1) uses onUnload handler to invoke xmlHttpRequest which saves the scroll
coordinates
2) uses those saved coordinates in onLoad handler next time the component
is displayed
However, there are two issues.
I have found no way to make this decoration "fork safe". The typical use
is like this
page 1: ScrollDecoration + Component A
component A calls component B, decoration saves coordinates
page 2: Component B
B answers
page 3: ScrollDecoration + Component A, decoration restores coordinates
So if you fork page 1, and call component B from each, only the scroll
coordinates for the last one are saved. Backtracking doesn't help here
because on page 3 we don't go back, we display the old components in new
step/context.
The second issue is related to publishing this decoration. It simply
doesn't work with the liveUpdate script that comes with seaside, because
the script can't handle requests that return empty/no answer. In fact the
script is too simplistic to handle most of the interesting stuff you might
want to do with background requests.
Avi? Julian? This area needs attention.
rado
More information about the Seaside
mailing list