Bonjour,
j'essaie de réaliser la communication entre deux widgets, j'ai essayé le code suivant mais sans aucun résultat !
j'utilise flex 4.6 & java
Widget 1
Widget 2
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4 private function widgetCommunication1():void { addSharedData("your key", shared data(ArrayCollection)); }
pourriez vous m'aider ?!!
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27 <viewer:BaseWidget xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:viewer="com.esri.viewer.*" initialize="basewidget1_initializeHandler(event)" > <fx:Script> <![CDATA[ import com.esri.viewer.AppEvent; import mx.events.FlexEvent; protected function basewidget1_initializeHandler(event:FlexEvent):void { ViewerContainer.addEventListener(AppEvent.DATA_PUBLISH, sharedDataUpdated); } private function sharedDataUpdated(event:AppEvent):void { var data:Object = event.data; if (data.key == "my key") { // do something.. } } ]]> </fx:Script>
Partager