[Seaside] callback returning content

Gerardo Richarte gera at corest.com
Tue Dec 2 15:59:29 UTC 2008


Hi, I'm still trying to implement the AMChart component (or whatever), 
and I managed to get down to the point when a URL is dynamically 
generated, requested, and my block is executed. Now, my problem is that 
this request does not generate any response, and rather generates a 302 
Found with a Location... kind of redirect to the page containing the 
callback.
The code I need should look like:

someJSFunction('http://host/seaside/blah?_s=...&_k=...&...');

and I need the URL to return something dynamically generated from the 
block, in the example below it's the string 'some string I want returned'.

My current try looks like:

javascriptCodeOn: html
    | encoder |
    ^ String streamContents: [:strm |
    strm nextPutAll: 'someJSFunction('.
    encoder := WAURLEncoder on: strm.
    encoder nextPutAll: (html context actionUrl
       addParameter: (html callbacks registerCallback: [
            'some string I want returned'])) asString.
    strm nextPutAll: ');'.
    ]

I also tried with registerActionCallback: and pretty much all the family.
Also tried with self answer: 'some string...', and other combinations...

    Any help? what's wrong with this, and more important, how's is it right?

    and then... I think this could make it into a useful tutorial. I may 
be the first outside the core team to write a complex Component (I doubt 
it), but I'm surely not the last to do it.

    thanks!
    richie


More information about the seaside mailing list