dimitri pater wrote:
> Hi,
> maybe someone here cab give me a clue on how to
accomplish the following:
> on http://www.serpia.org/wat
er I am running a test with ChartDirector,
> this page includes a form that trggers the action
"../makeGraph"
> makeGraph is something like this:
>
> def makeGraph(self, howmuch):
> # create a random string and concenate it
to png
> ...
> # The data for the bar chart
>
c.makeChart("../charts/"+a+"")
>
> result = []
> result.append('<h1>Reporting the
results!</h1>')
> result.append('<img
src="../charts/%s">' % a)
> return 'n'.join(result)
> makeGraph.exposed = True
>
> So that the chart gets a random name and is diplayed on
the webpage.
> But, what I really want to do is displaying the chart
on the ../water
> page (where the form also is)
> I have tried doing a redirect from ../makeGraph to
/water in stead of
> returning the result, but that only works if the
filename is always
> the same (using <img=" chart.png">. But
I need a random name every
> time a Chart is created.
> Any idea? Your help is appreciated!
There are several ways. One way is to have an
<iframe> to hold your
chart, have some Javascript that refreshes it when the user
hits <submit>.
Another way is to use something like AJAX to fetch the file
name, and
modify the <img> tag on the fly to insert the new
filename.
--
Tim Roberts, timr probo.com
Providenza & Boekelheide, Inc.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-users googlegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribe googlegroups.com
For more options, visit this group at ht
tp://groups-beta.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---
|