[Seaside] FormElement focus after an update

Lukas Renggli renggli at gmail.com
Wed Oct 3 16:14:19 UTC 2007


> The SeasideAsync package has some Javascript support for tracking
> events.
>
>         html textInput ...;
>                 forEvent: 'onblur' callback: [:event | ... ];
>
>         html textInput ...;
>                 onFocusCallback: [:event | ... ];
>                 ...
>
> where the event object has some interesting accessors.

Of course you can do the same with Scriptaculous:

html textInput
    onFocus: (html request
         callback: [ :value | current := value ]
         value: (SUEvent new element; access: 'id'));
    ...

Or more efficiently assign the same event to all input fields on the page:

html selector
    add: 'input';
    do: [ :each |
        each element
            on: 'blur' do: (html request
                callback: [ :value | current := value ]
                value: (SUEvent new element; access: 'id') ]

Cheers,
Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside mailing list