[Seaside] Creating a component that requires a callback:
gera at corest.com
Fri Nov 21 15:14:30 UTC 2008
Hi, I'm pretty new to seaside, and it's only parttime, but well, I'm
anyway trying to implement some sort of AMChartsComponent
(www.amcharts.com) (I find it nicer and better than PlotKit)
It should't be tricky, however, two things are making my process very slow:
to configure it, however, one of the arguments I need to supply to a
be static, and then use AMChartsLibrary / #something, but maybe I need
to dynamically create this XML, and hence I want to have some sort of
callback: mechanism, so Seaside creates a dynamic URL, and the block
answers with the XML. My question is, how do I create a component like
this? suppose my renderContentOn: today looks something like:
html script: 'doSomethingRequiringURL("http://localhost/seaside/blah");'
I guess I could somehow turn it into:
html script: 'doSomethingRequiringURL(', (AMChartLibrary /
but I'd really like to do something more like
settings: [:xml | xml blah...]
And then, inside this XML there is another URL, that points to the data
source to plot. I'm still not sure how the interface to all this will
look like, but I certainly want this URL to again, be generated dinamically.
so, a couple of questions.
. How do I create a component that uses something like the callback
mechanism? (how do I get seaside to generate the URL for me and do all
. Do you have any design ideas on how I should better implement this? I
guess I'll try to follow how PlotKit is used, so the interfaces to the
two are somehow compatible.
Right now I only want a quick hack, but eventually, if this finally
works and I somehow like it, I'll contribute it... of course, if
somebody has already done it, I'm more than willing to reuse :)
More information about the seaside