I have set up a Perspective view that has a button that runs a script to perform a query and then send it to a Python WebDev resource that consists of a script that pulls the data out of the body, processes, builds the html for a JavaScript SVG chart.
I would to like view this on the same view as the button. I have successfully sent the data to the endpoint and returned the dataset to the console. Also the html comes back.
However, nothing is drawing in the iframe.
I tested just a static version of the same html in a doGet to the same endpoint and the chart is drawing.
I have not tried to pass the dataset in the url to a doGet because I am worried about the size limits of data passed in a url
Does anyone know if the iframe will render the html code in this way?
Any script you run will be issued from the gateway, not your running session, so the updated HTML returned by your Webdev endpoint is just going to end up lost.
Could you have your Webdev endpoint return an image file or SVG, and use that directly in an image in your view, instead of using the iframe?
This is going to be a tricky thing to accomplish within your constraints.
I would prefer that I was able to send the data to WebDev and have it send the html back and have it rendered directly in an iframe in Perspective but it seems that’s not possible.
So the next option seems to be a solution that will return the chart as an image to a perspective page.
I saw your module and that it was designed for Vision.
What prevents me from having batik or some other java taking the svg content in the doPost endpoint and returning it to an image container in Perspective?
If you don't need to manipulate it, I don't see why WebDev cannot do this. You will need two endpoints:
One to receive the post with the SVG. This would cache the content somewhere. I'd recommend a sessionVarMap, targeting the Perspective session that wants this image. Or in a database. Then message or otherwise trigger a event in the session to display an IFrame or Image component with the URL for:
The endpoint that retrieves the SVG and serves it.