Note that there are some explanatory texts on larger screens.

plurals
  1. POUpdate SVG file using Ajax, by retrieving some information from a Java Servlet
    primarykey
    data
    text
    <p>I have written a Java Servlet that retrieves a SVG image. The content type for this servlet is <code>CONTENT_TYPE = "image/svg+xml";</code></p> <p>This certain servlet is being integrated in a bigger (ADF11g) application as an inlineframe. The code should look familiar, if you are accustomed with JSP:</p> <pre><code> &lt;af:inlineFrame source="servlet?Filename=TestSVG1&amp;amp;width=1024&amp;amp;height=1024" inlineStyle="width :#{session.graphSVGWidth}px; height:#{session.graphSVGHeight}px; border: none"&gt; &lt;/af:inlineFrame&gt; </code></pre> <p>This SVG contains a dyanmic popup that allows the user to interact "with the picture", by sending information to the server via Ajax calls. </p> <p>For example this a part of JavaScript that is being used by the SVG:</p> <pre><code>function loadXMLDocPOST(params) { var xmlhttp = getXmlHttp(); xmlhttp.open("POST", 'servlet', true); xmlhttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded"); xmlhttp.setRequestHeader("Content-length", params.length); xmlhttp.setRequestHeader("Connection", "close"); xmlhttp.onreadystatechange = function () { if (xmlhttp.readyState == 4 &amp;&amp; xmlhttp.status == 200) { /* Do something here */ } else { //alert('xmlhttp.status_r2=' + xmlhttp.status); } } xmlhttp.send(params); } function editAction(Filename, Name){ loadXMLDocPOST(...) } </code></pre> <p>The Ajax call is successful, but the problem is that after I trigger some actions from the SVG, I want to update the picture contained in the inline frame (the <code>/* Do something here */</code>)</p> <p>So, how do I rerender the SVG, from inside the SVG :) ? The problem is that <code>innerHTML</code> is not working in SVG. <code>document.write()</code> is not working either. So do you have any suggestions ?</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload