Discussions
Categories
Groups
Community Home
Categories
INTERNAL ENABLEMENT
POPULAR
THRUST SERVICES & TOOLS
CLOUD EDITIONS
Quick Links
MY LINKS
HELPFUL TIPS
Back to website
Home
Intelligence (Analytics)
onCreate() event on Master page
Scarlett
So I have a grid element in my report that references a function coming from a *.js file. This works just fine. But on the Master Page I also need to manipulate the logo which I intend to do on the onCreate event. However, when I add code to this event for the logo, my table element cannot access the function in the *.js file. I've also tried moving the function from the .js file to the initialize event of the report. Still no luck.
Can somebody please help me with this issue?
Find more posts tagged with
Comments
kclark
What BIRT version are you using? I wrote a simple JS file like this<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
function test() {
return (1+3);
}
</pre>
<br />
Then I added that JS file to the resources and then included the file from properties > resources > JavaScript Files.<br />
<br />
Then from the onCreate() of a label in my masterpage headers<br />
<br />
<pre class='_prettyXprint _lang-auto _linenums:0'>
var testVar = test();
this.text = testVar;
</pre>
<br />
Can you recreate this with the sample DB and post it?
Scarlett
Hi kclark,
I did some investigating and I think I've narrowed it down. I have java (not JS) in my onCreate() event with import statements et al. (I'm not an expert on Java so pardon me if this sounds incorrect). My JS file is just that, javascript. When I remove the import statements, the code in my onCreate() event fails (obviously) but now the methods from the JS file work correctly. What am I missing here?
-Scarlett
kclark
Can you post the rptdesign? What package are you importing in the onCreate()?