[Seaside] Re: onSuccess: problem
estebanlm at gmail.com
Sat May 10 02:10:56 UTC 2008
It is so easy! I'm feel like a dumb... I tried everything, except that.
On 2008-05-09 21:34:46 -0300, "Ramon Leon" <ramon.leon at allresnet.com> said:
>> 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...
> alert: anObject
> self add: (SUStream new
> nextPutAll: 'alert';
> argument: anObject;
> 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...
> do this...
> onSuccess: (SUStream on: 'window.alert("OK")')
> And it'll work.
> Ramon Leon
More information about the seaside