GlobaData lost when opening a new window

Add-in Express™ Support Service
That's what is more important than anything else

GlobaData lost when opening a new window
 
christianbpedersen




Posts: 34
Joined: 2009-07-19
I use GlobalData for storing information used by my CommandItem. This works fine between tabs, but if a link opens a new window, this data is not available anymore. How can I make the information in GlobalData available between windows?

Cheers,
Christian
Posted 09 Aug, 2010 05:08:59 Top
Andrei Smolin


Add-in Express team


Posts: 18827
Joined: 2006-05-11
Hi Christian,

Please pay attention to http://www.add-in-express.com/creating-addins-blog/2009/06/19/internet-explorer-plugin-settings-synchronize/.


Andrei Smolin
Add-in Express Team Leader
Posted 09 Aug, 2010 06:02:15 Top
christianbpedersen




Posts: 34
Joined: 2009-07-19
In a file?

So, whenever the plugin needs to use its data, it should load and parse the file from disk? This would have to happen on each page load. Is that really so??

I don't care what happens to the data when the user quites Internet Explorer (closes all windows), it's only during the session. I see that session cookies variables are shared between the windows - can't my plugin data be as well?

Christian
Posted 09 Aug, 2010 07:05:02 Top
Andrei Smolin


Add-in Express team


Posts: 18827
Joined: 2006-05-11
Hi Christian,

christianbpedersen wrote:
Is that really so??


The file is read only once, when you start the first add-on instance. Also, you can minimize the load using the registry, not a file.

christianbpedersen wrote:
I see that session cookies variables are shared between the windows - can't my plugin data be as well?


The sample add-on above deals with the situation when the user runs several IE processes, not just windows. Note that IE may start an extra process when you open a new tab; you can check this by opening several tabs.


Andrei Smolin
Add-in Express Team Leader
Posted 09 Aug, 2010 08:30:29 Top
christianbpedersen




Posts: 34
Joined: 2009-07-19
But if on window change the data, and this data should be available to another window, that window would have to read the file again, right?
Posted 09 Aug, 2010 10:10:25 Top
Andrei Smolin


Add-in Express team


Posts: 18827
Joined: 2006-05-11
Hi Christian,

Quote
christianbpedersen wrote:
But if on window change the data, and this data should be available to another window, that window would have to read the file again, right?

There's another way: the first window (=add-in instance) can send a message to other add-in instances via SendMessageToAll.


Andrei Smolin
Add-in Express Team Leader
Posted 11 Aug, 2010 10:22:05 Top