Hello all,
I am executing javascript and fetching the svg for one of my vaadinForVisualization chart, the svg i got from current html page. I have actually created a textField and set its debug id to “textField123” and using the following javascript I am setting the value of the textField.
String jScript = //"alert('Hello java');" +
"saveAsImg(document.getElementById(\"test1234\"));" +
"function getImgData(chartContainer) {" +
" var chartArea = chartContainer.getElementsByTagName('iframe')[0]
.contentDocument.getElementById('chartArea');" +
" var svg = chartArea.innerHTML;" +
" document.getElementById('textField123').value = svg;}" +
"function saveAsImg(chartContainer) {" +
//" alert('Insiide saveAsImg');" +
" var imgData = getImgData(chartContainer);" +
"}";
getMainWindow().executeJavaScript(jScript);
But the problem I am getting is, when from my application class I am trying to getValue of this TextField its returing the null value. But on that html page the textfield value is being set by the javascipt, but still its not returning the value of the textfield.
And I missed one thing to add above is that, when I click on the textfield manually then it shows and returns value for that text field.
Any help to regarding this would be a great help. Do write.
Cheers!!!