[Seaside] #urlForDocument: w/o canvas?
ssastre at seaswork.com
Wed Oct 15 14:08:54 UTC 2008
For elegance you can make that dictionary to be in an inst var of your wrapper
component and in the render method json that instvar (presumably with a proper
That way could potentially be changed in any calback and then render properly
according to that.
Make some convenience accessors and you're done,
PD: that, of course, if I understood you right ;)
> -----Mensaje original-----
> De: seaside-bounces at lists.squeakfoundation.org
> [mailto:seaside-bounces at lists.squeakfoundation.org] En nombre
> de Udo Schneider
> Enviado el: Miércoles, 15 de Octubre de 2008 08:00
> Para: seaside at lists.squeakfoundation.org
> Asunto: [Seaside] #urlForDocument: w/o canvas?
> 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?
> seaside mailing list
> seaside at lists.squeakfoundation.org
More information about the seaside