[Seaside] Rendering Component in a WAPragmaBasedRestfulHandler
Das.Linux at gmx.de
Wed Apr 13 16:10:24 UTC 2011
Am 2011-04-13 um 17:38 schrieb Camillo Bruni:
> I am onto building test website in seaside which should have nice urls. I stumbled upon the Seaside-REST package, which seems like a nice solution to map the urls onto state and components.
> However so far I could not figure out how I should render a component from within a WAPragmaBasedRestfulHandler method.
> This is how I imagine it should work:
> request -> stateful request handler -> choose component and initialize state -> render component
> What is the proper way to do this?
Think of this:
MyComponent new respondRendered
self requestContext respond: [:response |
contentType: WAMimeType textHtml;
nextPutAll: ( WARenderCanvas builder
rootBlock: [ :root |
self updateRoot:root ];
render: [ :canvas |
self renderContentOn: canvas ])].
This merely emulates a normal seaside run.
But more elaborate versions are possible.
More information about the seaside