ViewerContainer.dispatchEvent(new AppEvent(AppEvent.WIDGET_RUN, 2));
public var _configData:ConfigData; public function getWidgetId(widgetLabel:String):Number { var id:Number = Number.NaN; for (var i:Number = 0; i < _configData.widgets.length; i++) { if (_configData.widgets.label == widgetLabel) id = _configData.widgets.id; } return id; } //find the postConfigHandler function and change this line var configData:ConfigData = _configData = event.data as ConfigData;
ViewerContainer.getInstance().widgetManager.getWidgetId(<MyWidgetLabel:String>)
ViewerContainer.getInstance().widgetManager.getWidget(<id:Number>,<optional open-when-not-open:Boolean>)
AppEvent.dispatch(AppEvent.WIDGET_RUN, id), where id is an int. This part isn't explicitly mentioned within the Flex Viewer source code comments.
AppEvent.AddListener(AppEvent.<EVENT_TYPE>, <Callback>).
Changing a little bit the question, how can I change the data of a Wdiget already opened from another widget. I want to change the source of an image from one widget when i make a selection on another widget. I'm not using WidgetTemplate son i can't use function "open". I'm transfering the data with a TransferDataManager
Thanks
Rinat
Rinat,
So if you are not using the BaseWidget at least then you still have access to addSharedData and other widget communication functions. Our you just set a public var in the fidget toy are wanting to change something in and use
ViewerContainer.getInstance().widgetManager.getWidget
to get access to the other widget and then set that public var.
I have no idea what TransferDataManager is...