[Seaside] #onScroll: with positions

Lukas Renggli renggli at gmail.com
Tue Mar 25 09:17:33 UTC 2008

>  We would like to implement a GoogleReader-like table component which
>  loads additional data to the table while scrolling down to (or near)
>  the bottom. We tried #onScroll: event but it does not include position
>  parameters for scroller. The possible decision is to implement a
>  client-side script posting those parameters, but we are not sure how
>  to do it in practice.

Note that onScroll: is not a standard event, so most certainly it
won't work on all browsers. Never the less, you can try something like
the following:

    html div id: 'info'.
    self session addLoadScript: (html scriptaculous event
        observe: html scriptaculous window
        on: 'scroll' do: (html updater
            id: 'info';
            callback: [ :v | x := v ] value: (html scriptaculous
window access: 'scrollX');
            callback: [ :v | y := v ] value: (html scriptaculous
window access: 'scrollY');
            callback: [ :r | r render: x , ' x ' , y ])).


Lukas Renggli

More information about the seaside mailing list