[Seaside] onSuccess: problem
ramon.leon at allresnet.com
Sat May 10 00:34:46 UTC 2008
> Hi all,
> I'm having problems with html request... onSuccess:, this is
> what i'm doing:
> html anchor
> class: #eventRefresh;
> onClick: (
> (html request
> callback: [ Transcript show:
> 'REQ'; cr ];
> onSuccess: 'window.alert("OK")';
> onFailure: 'window.alert("Failure")'));
> with: [ html image url: SushiLibrary / #addPng ]
> This is rendering all ok ('REQ' is being written on
> transcript window)
> ... but onSuccess (or onFailure) is not being called after it...
onSuccess: (html alert: 'OK')
If you look at how #alert: is implemented...
self add: (SUStream new
into #onSuccess:. Scriptaculous events like #onSuccess: do not work like
Seaside events like #onClick: or #onChange:. Seaside events assume they're
Scriptaculous events call #asFunction on whatever you give them, so when you
give them a string, they wrap a function around it...
onSuccess: (SUStream on: 'window.alert("OK")')
And it'll work.
More information about the seaside