Hi:
I have added code to automatically save the current settings (for example, visible layers, map extent... ) when the Browser window is closed. Next time when FlexViewer is launched, the previous settings will be loaded automatically. This part works very well.
The problem is the TOC widget when loaded always set the CheckBoxes based on the Map Service sublayers' DEFAULT VISIBILITY.
I looked through this forum. Some suggest to add a customized Event Listener in TocItem. But the code to load the user's previous settings is added in MapManager.mxml. Based on the "Application life cycle", MapManager loads the map services first based on the configuration settings. Then the WidgetManager loads the widget's Flash files from the uniform resource locators (URLs) based on the configuration settings.
So even I dispatch a customized event in MapManager.mxml, the TOC widget won't catch it as it is not loaded yet.
Is it possible to get the visible layers in current map instead of using the Default Visibility when create the TOC item at initalization?
Any insights?
Thanks a lot!
Rose