Hi.. I am very new to flex development and need urgent help. I am trying to pass the objectid of the clicked point from one widget to another.For that I am using addshareddata in my source widget.recAC.addItem(obj.OBJECTID);
addSharedData("HelloWorldWidget", recAC);
In my destination widget I am adding the following two listeners in the creationcomplete event of the widget. AppEvent.addListener(AppEvent.DATA_PUBLISH, sharedDataUpdated);
AppEvent.addListener(AppEvent.DATA_SENT, sharedDataUpdated);
sharedDataUpdated function is given belowprivate function sharedDataUpdated(event:AppEvent):void
{
var data:Hashtable = event.data as Hashtable;
Alert.show("Length is "+data);
if (data.containsKey("HelloWorldWidget"))
{
var myAC:ArrayCollection =data.find("HelloWorldWidget") as ArrayCollection;
Alert.show("Length is "+myAC.length);
}
}
The problem is that the first Alert is giving data as null. And the if condition is not returning true. The code is not going inside the if. Please help me in retrieving the data here. I am stuck in this for days now. Thanks in advance.