[Seaside] Re: #urlForDocument: w/o canvas?
Udo Schneider
Udo.Schneider at homeaddress.de
Wed Oct 15 15:37:40 UTC 2008
Hi Sebastian,
> 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
> dictionary).
As far as I can see it I can move some of the code to a separate method.
E.g.:
initialize
super initialize.
swf := SwfObject new.
swf
alternativeContent: [:html | html text: 'Flash is being loaded'];
extent: 640 @ 480;
url: OFCFileLibrary / #openflashchartSwf
ofcVariables: html
^(Dictionary new)
at: 'data-file' put: (html context urlForDocument: self data);
yourself
However I still see a problem: To obtain a URL for the data-file in
#ofcVariables: I still have to call #urlForDocument. And this is only
possible to do it by calling the current renderers context and ask it
for the document URL.
I think what I would need is a way to get a URL for some content which
is not dependent on the canvas (i.e. initialized /once/ in the
#initialize method of the parent component). IMHO something between
using #urlDocument: /which depends/varies on the per render-run canvas)
and using a static file (using WAFileLibrary and friends.
> That way could potentially be changed in any calback and then render properly
> according to that.
Callback rings a bell for me - is there a way to define a callback (and
getting it's URL) and to define what kind of content to return?
> PD: that, of course, if I understood you right ;)
You did - I just may have been a bit unclear. It's not that it doesn't
work right know - it's just that changing a sub-components state during
a render-run seems wrong to me.
CU,
Udo
More information about the seaside
mailing list