[Seaside] Re: Any design pattern for scroll issue when using call/answer?

Hilaire Fernandes hilaire at ofset.org
Wed Mar 25 09:25:17 UTC 2009

I try to see the difference facet of the problem regarding mix use of
composition and the scroll problem. May be my view is partial because I
don't know much javascript, but here it goes:

So far, I see mainly 3 concomitant issues:

1. when you call a sub component, the canvas scrolls back to the top

2. when you return from a sub component, the canvas scrolls back to the

3. when you click a link with a callback changing the state of the
canvas, it scrolls back to the top

Regarding the history of the comments in this mailing list, I see the
problem can be solved using anchor.

But the problem is far to be optimal as it breaks reusability of the

For issue #1, I try with a special Anchor decoration, with this render
renderContentOn: html
	html anchor 
		name: anchor; 
		script: (SUScript new goto: '#', anchor).	
	html text: ''.
	self renderOwnerOn: html.

Don't ask me why the html text: '', otherwise the anchor is rendered
toward the end of the component (is it because the component has the
Form decoration?).

The decoration does not solve entirely reusability because the #answer
message in the sub component is out of the reach of the decoration. So
you still need to subclass component to get the scroll back issue #2
fixed, for example I sub-class WAChoiceDialog to override method ok:
	self session jumpToAnchor: anchor .
	super ok

Not nice

For issue #3, it is quite simple:
html anchor 
	callback: [attribute pushVersion: 'votre texte'.
		self session jumpToAnchor: self hash asString];
	with: '( + )'.

Any comments or additional ideas?


Le mardi 24 mars 2009 à 14:31 +0100, Hilaire Fernandes a écrit :
> Hello, 
> Are there a well known pattern for seaside to deal with the browser
> scrolled page when using sub-component and callback?

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Ceci est une partie de message
	=?ISO-8859-1?Q?num=E9riquement?= =?ISO-8859-1?Q?_sign=E9e?=
Url : http://lists.squeakfoundation.org/pipermail/seaside/attachments/20090325/4f1294a1/attachment.pgp

More information about the seaside mailing list