[Seaside] #urlForDocument: w/o canvas?

Udo Schneider Udo.Schneider at homeaddress.de
Wed Oct 15 10:00:20 UTC 2008


I'm a bit confused about #urlForDocument: in a non-render method.

Background: I'm having a component (SwfObject) which wraps the SWFObject 
.js library. This component gets initialized in my Application:

   super initialize.
   swf := (SwfObject new)
     alternativeContent: [:html | html text: 'Flash is being loaded'];
     extent: 640 @ 480;
     url: OFCFileLibrary / #openflashchartSwf;

In the render code of my app I render this component. However the flash 
needs a reference to some content using #urlForDocument: . So I need to 
set this in the render method:

renderContentOn: html
     variables: ((Dictionary new)
       at: 'data-file' put: (html context urlForDocument: self data);
       yourself) jsonString.
   html render: swf

This works w/o problem. However the data does not change from render to 
render. So what I would like to do is to set the #variables: in 
#initielize as well - however this is not possible because I need 
#urlForDocument: which is only available through the canvas?

My bad gut feeling comes from the point that I do not want to change 
components during render - only as a result of an action. At this point 
I have no choice but to do it?

So I'm asking myself whether it is possible to get an URL for a document 
outside of the render run - maybe a URL to a (delayed) MIMEDocument 
which gets it's content via a pluggable block?

I would love to do something like this in #initialize.

swf variables: ((Dictionary new)
     at: 'data-file' put: (self urlForDelayedDocument: [self data]);
     yourself) jsonString.

Any pointers?



More information about the seaside mailing list