Here's the scenario:I have created 3 new widgets, all identical copies of the LayerListWidget component, except for the widget label. At some point I want to execute a public function on those 3 widgets; its definition remains the same.Even after following Robert Scheitlin's advice from this old thread and forcing the same application domain on all widgets ( ESRI recommendation), I am still unable to cast an instance of the new widget to the generic LayerListWidget (the original LayerListWidget is loaded as a module.)var id:Number = ViewerContainer.getInstance().widgetManager.getWidgetId(widgetLabel); //correct
var bWidget2:IBaseWidget;
bWidget2 = ViewerContainer.getInstance().widgetManager.getWidget(id,false);//returns LayerListParcelsWidget
var vLLW2:LayerListWidget = bWidget2 as LayerListWidget;//returns null
The application domain is defined in WidgetManager.mxml as:wgtInfo.load(ApplicationDomain.currentDomain, null, null, moduleFactory);
Compiler arguments:-locale en_US -source-path=locale/{locale} -keep-all-type-selectors=true
FlexViewer 2.4 (July 2011), Flex 4.1, ArcMap 10.0, SP1It looks like casting is not possible between identical component copies. Is there another way to do the casting?Thanks,Valentina Boycheva