widgetID = ViewerContainer.getInstance().widgetManager.getWidgetId("widgetName"); iWidget = ViewerContainer.getInstance().widgetManager.getWidget(widgetID,true); if(!iWidget) { var timer:Timer = new Timer(1000,1); timer.start(); timer.addEventListener(TimerEvent.TIMER_COMPLETE, completeHandler); function completeHandler(event:TimerEvent):void { addSharedData("popUser", new ArrayCollection([userData.text])); timer.stop(); } } else addSharedData("popUser", new ArrayCollection([userData.text]));
Solved! Go to Solution.
AppEvent.addListener(AppEvent.DATA_SENT, sharedDataUpdated2); fetchSharedData();
private function sharedDataUpdated2(event:AppEvent):void { var dataTable:Hashtable = event.data as Hashtable; if (dataTable.containsKey("popUser")) { var recAC:ArrayCollection = dataTable.find("popUser") as ArrayCollection; for (var i:Number = 0; i < recAC.length; i++) { var obj:Object = recAC; //todo } dataTable.remove("popUser"); }else if(dataTable.containsKey("Deactivate_DrawTool")) { setMapAction(null, null, null, null); } }
AppEvent.addListener(AppEvent.DATA_SENT, sharedDataUpdated2); fetchSharedData();
private function sharedDataUpdated2(event:AppEvent):void { var dataTable:Hashtable = event.data as Hashtable; if (dataTable.containsKey("popUser")) { var recAC:ArrayCollection = dataTable.find("popUser") as ArrayCollection; for (var i:Number = 0; i < recAC.length; i++) { var obj:Object = recAC; //todo } dataTable.remove("popUser"); }else if(dataTable.containsKey("Deactivate_DrawTool")) { setMapAction(null, null, null, null); } }
ah ha! I didn't know about the fetchSharedData function. Thank you again Robert, that worked like a charm. I feel like ESRI should be paying you by the volume of answers and support you provide to this community. 🙂