Select to view content in your preferred language

hash table does not return data in  sharedDataupdate2

709
5
12-03-2012 10:16 PM
NadeemQazi
Regular Contributor
I have successfully achieved the widget communication following  widget communication.pdf  Prepared By: Robert J. Scheitlin.  I have noticed one thing and it is that when sharedDataUpdated2 is fired the hash table does not contain any data, why it is so?. however when the sharedDataUpdated is fired than array collection data array contains the data. i have applied this lines of code in init function of basewidget:
AppEvent.addListener(AppEvent.DATA_PUBLISH, sharedDataUpdated);
AppEvent.addListener(AppEvent.DATA_SENT, sharedDataUpdated2);
fetchSharedData();

and in the sharedDataupdated2 i have following code:
var dataTable:Hashtable = event.data as Hashtable
however event.data does not contain any data and all of its key are empty as i checked in the debugger. therfore when i checked dataTable.find("KernelDensityData") IT RETURNS FALSE. there only sharedDataupDated returns the data but sharedDataupdated2 does not.
Any thought please.
regards
nadeem
Tags (2)
0 Kudos
5 Replies
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

   Where in your code are you using addSharedData? You can not fetch shared data unless you have added it.
0 Kudos
NadeemQazi
Regular Contributor
Nadeem,

   Where in your code are you using addSharedData? You can not fetch shared data unless you have added it.


yes i did  use addsharedData in  my widget that wish to pass the data to other widget.here is the code.

var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId("widgetLabel");
    var bWidget:IBaseWidget = ViewerContainer.getInstance().widgetManager.getWidget(id, true) as IBaseWidget;
    if (bWidget){
     var vSW:* = bWidget;
    
     addSharedData("myData", myArray);
where myArray is array collection variable which contains the data that need to be passed in other widgets.  
as i wrote before that i have received data in SharedUpDateData but not in sharedDataUpdated2.
regards
nadeem
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

   If you keep on post generic code like this I can not tell where you are going wrong in your implementation.
0 Kudos
NadeemQazi
Regular Contributor
Nadeem,

   If you keep on post generic code like this I can not tell where you are going wrong in your implementation.


thanks Robert , I have sorted out the problem. thanks for your help.
regards
nadeem
0 Kudos
RobertScheitlin__GISP
MVP Emeritus
Nadeem,

   Glad to hear that. Make sure you mark this thread as answered then.

Click the Mark as answer check on this post and to click the top arrow (promote).
Follow these steps as shown in the below graphic:

0 Kudos