Solved! Go to Solution.
Seems to happen for me on sublayer popups only and occurs in the getlayerinfos code in createChildren (TocMapLayerItem). When loading the toc the layer info returns a null which interrupts the widget loading process causing the UI to look a bit crazy.
TypeError: Error #1009: Det går inte att få åtkomst till en egenskap eller metod för objektreferensen null. at widgets.TOC.toc.tocClasses::TocMapLayerItem/createChildren() at widgets.TOC.toc.tocClasses::TocMapLayerItem() at widgets.TOC.toc::TOC/registerMapLayer() at MethodInfo-626() at widgets.TOC.toc.utils::MapUtil$/forEachMapLayer() at widgets.TOC.toc::TOC/registerAllMapLayers() at widgets.TOC.toc::TOC/commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/doPhasedInstantiation() at mx.managers::LayoutManager/doPhasedInstantiationCallback()
Wondering if anyone has come up with a way to consistantly make it do this?
//var popUpConfigURL:String = arrLayerPopUp.popUpConfig; var popUpConfigURL:String = String(arrLayerPopUp.popUpConfig) + "?ts=" + new Date().getTime();)
TypeError: Error #1009: Det går inte att få åtkomst till en egenskap eller metod för objektreferensen null. at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem/createChildren() at com.esri.viewer.components.toc.tocClasses::TocMapLayerItem() at com.esri.viewer.components.toc::TOC/registerMapLayer() at MethodInfo-386() at com.esri.viewer.components.toc.utils::MapUtil$/forEachMapLayer() at com.esri.viewer.components.toc::TOC/registerAllMapLayers() at com.esri.viewer.components.toc::TOC/commitProperties() at mx.core::UIComponent/validateProperties() at mx.managers::LayoutManager/validateProperties() at mx.managers::LayoutManager/doPhasedInstantiation() at mx.managers::LayoutManager/doPhasedInstantiationCallback()
Maybe this isn't what you ment but in an earlier version I added timestamps to URLs to prevent browsers to read any config-files from cache. When adding this to my 3.1 viewer I'm getting the same problem everytime, even after refreshing the site, which is kind of obvious since the problem comes after clearing the cache and now the browser doesn't read from cache.
The timestamp for popus I added to Mapmanager.mxml in the function "configurePopUps"//var popUpConfigURL:String = arrLayerPopUp.popUpConfig; var popUpConfigURL:String = String(arrLayerPopUp.popUpConfig) + "?ts=" + new Date().getTime();)
We are many users experience this problem, this thread http://forums.arcgis.com/threads/76137-Header-widget-display-issue-when-upgrading-to-3.1 is about the same problem. I hope the ESRI Flex Team could take a closer look at this...
var visLayers:Array = [];
var arcGISDynamicMapServiceLayer:ArcGISDynamicMapServiceLayer = ArcGISDynamicMapServiceLayer(layer);
_dynamicMapServiceLayerInfos = arcGISDynamicMapServiceLayer.dynamicLayerInfos ? arcGISDynamicMapServiceLayer.dynamicLayerInfos : arcGISDynamicMapServiceLayer.layerInfos;
if(arcGISDynamicMapServiceLayer.visibleLayers){
arcGISDynamicMapServiceLayer.visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, visibleLayersChangeHandler);
}else{
visLayers = getActualVisibleLayers(MapServiceUtil.getVisibleSubLayers(_dynamicMapServiceLayerInfos), _dynamicMapServiceLayerInfos);
ArcGISDynamicMapServiceLayer(layer).visibleLayers = new ArrayCollection(visLayers);
ArcGISDynamicMapServiceLayer(layer).visibleLayers.addEventListener(CollectionEvent.COLLECTION_CHANGE, visibleLayersChangeHandler);
}
_visibleLayersChangeWatcher = ChangeWatcher.watch(arcGISDynamicMapServiceLayer, "visibleLayers", visibleLayersChange);