[Seaside] Page Refresh back to same html element

Lukas Renggli renggli at gmail.com
Tue Jan 1 21:28:30 UTC 2008

> I was wondering if there is a way to get back to the html element
> that was last edited or clicked on.

3 lines of Scriptaculous-Smalltalk code:

For every form element you do something like (maybe you need a
different way to get unique IDs for your form elements):

  | id |
  html textInput
    value: text;
    callback: [ :v | text := v ];
    " now comes the extra suff "
    id: (id := html nextId);
    onChange: (html request callback: [ activeId := id ])

Then at the end of the page you do:

  self session addLoadScript: (html element id: id; scroll)

Also see the mailing-list archive, I am sure this question has been
asked several times already.


Lukas Renggli

More information about the seaside mailing list