> I understand that a static destination url for
> such clicks is not compatible with the
> weblocks view of things. I want to avoid inlining the SVG (which would
> probably allow me to use dynamic url as render-link generates them)
> for portability problems (I have to cater to MSIE).
>
> What is a suggested solution?
You need to serve your SVG file dynamically.
Convenient support for this isn't in Weblocks yet,
but you can use a dispatcher.
Example:
(defun my-svg-handler ()
(setf (hunchentoot:content-type) "image/svg")
"<svg/>")
(push (hunchentoot:create-prefix-dispatcher
"/pub/svg/my-svg"
#'my-svg-handler)
hunchentoot:*dispatch-table*)
You can of course render your widget in MY-SVG-HANDLER
as well, and dynamically generate your onclick JS.
Leslie
> Where in this scheme do I get access to a session handle? Lets say, to
> the widget instance whose render-body method inserts the reference to
> the svg file?
Using -dev you could use FIND-WIDGET-BY-ID.
> Maybe I'm blocked here and it just magically works if?
No magic here, you're basically walking uncharted territory. :)
> Should I encode a token into the SVG's url to have it available
> in the my-svg-handler you suggested?
Yes, that's a good way to do it. I recommend it over the FIND-WIDGET
approach above.