Discussions
Categories
Choose a Product
THRUST SERVICES
CORE APPS
CE PRODUCTS
...
Quick Links
POPULAR
HELPFUL TIPS
Groups
My Links
FOR SIGNED IN MEMBERS:
Back to website
Home
Designing Analytics Reports
using get/setPersistentGlobalVariable in scripts
Migrateduser
<p>Hello,</p><p> </p><p>I have a question on how the functions getPersistentGlobalVariable(...) and setPersistentGlobalVariable(...) work in the scripts.</p><p> </p><p>So I have a script for the beforeOpen event in my dataset. It looks like this:</p><p> </p><p>fieldKey = "0";</p><p>reportContext.setPersistentGlobalVariable("fieldKey",fieldKey);</p><p> </p><p>Then I have a script for the onCreate event for one of my controls. It looks like this:</p><p> </p><p>importPackage( Packages.javax.swing );</p><p> </p><p>fieldKey = reportContext.getPersistentGlobalVariable("fieldKey");</p><p> </p><p><strong class='bbc'>if</strong> (fieldKey != <strong class='bbc'>null</strong>)</p><p>{</p><p>print(fieldKey);</p><p>}</p><p><strong class='bbc'>else</strong></p><p>{</p><p>print("fieldKey is null");</p><p>}</p><p> </p><p><strong class='bbc'>function</strong> print(message)</p><p>{</p><p>frame = <strong class='bbc'>new</strong> JFrame( message ); </p><p>frame.setBounds( 310, 220, 300, 20 ); </p><p>frame.show( ); </p><p>}</p><p> </p><p>The JFrame message that gets printed out is always "fieldKey is null".</p><p> </p><p>Why is fieldKey null if I set it with setPersistentGlobalVariable(...) in the dataset's beforeOpen event handler and then tried to retrieve it with getPersistentGlobalVariable(...) in the control's onCreate event handler?</p><p> </p><p> </p><p> </p>
Find more posts tagged with
Comments
There are no comments yet