Hi,<br />
<br />
I have problem with conversion events from javascript to java handlers.<br />
<br />
When I wanted to share an object in javascript among events I made global variable. But how to share objects among java handlers?<br />
<br />
For example scripted data source and dataset.<br />
In javascript I put code into "open" of scripted data source event - I opened connection and send results to BufferReader global object. Then in scripted data set event "fetch" I read the global variable of BufferReader object. And as last for scr. datasource "close" event I closed BufferReader object and close connection.<br />
<br />
open event in scripted data source<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var myUrl= new Packages.java.net.URL("http://blabla.com/blabla");
[b]// global variable of js for closing in 'close'[/b]
is = myUurl.openStream();
[b]// global variable of js for reading in 'fetch'[/b]
reader = new Packages.java.io.BufferedReader( new Packages.java.io.InputStreamReader( is, "UTF-8" ));
</pre>
<br />
fetch event in scripted data set<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
[b]//reader is ready for reading

[/b]
while ((scriptRow = reader.readLine()) != null) {
var rowData = scriptRow.split(",");
dataSetRow["row1"]= rowData[1];
return true;
}
return false;
</pre>
<br />
But in java? I have no assigment methods. Or am I blind? Maybe there is another mechanism of working with shared object...<br />
<br />
<br />
thanks for help<br />
Jan