Hello.
Again a little SVG problem. I hope someone can help me. I want to pass a
parameter from javascript function 'onclickFunction' in the SVG code to
my portlet. I doesn't work. It displays the SVG the right way but when I
click the SVG circle it doesn't display the '<br>i got the
parameter!'...
Here is the Java code:
public void doView(RenderRequest request, RenderResponse response)
throws PortletException, IOException {
response.setContentType("text/html");
PrintWriter writer = response.getWriter();
if (request.getParameter("par") != null) {
writer.println("<br>i got the parameter!");
} else {
writer
.println("<p align=\"center\">Hello World</p>"
+ "<embed src=\""
+ response.encodeURL(request.getContextPath())
+ "/Test.svg\" type=\"image/svg-xml\" width=\"100px\"
height=\"100px\"/>");
}
}
And here is the SVG code:
...
function onclickFunction(evt)
{
getURL("http://localhost:8080/HelloWorld?par=dummy",
callbackFunction);
}
function callbackFunction(urlRequestStatus)
{
}
...
<circle id="id-01" cx="50" cy="50" r="20" onclick
="onclickFunction(evt)" style="fill:green">
</circle>
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]