Select to view content in your preferred language

TypeError: Error #1034: IndexChangeEvent when use InfoWindowRenderer with large application

3719
5
09-18-2014 03:22 AM
MarcusFritze
Deactivated User

Hi,

I use a InfoWindowRenderer based on this example:

https://developers.arcgis.com/flex/sample-code/clustering.htm

When I use this in my example project (for testing) this is working without any problems. So I decided to implement this in my large application.

When I implemented this and click on the cluster, the InfoWindow opens, but when I click on the arrows in the InfoWindow the app crashes...

Bildschirmfoto 2014-09-18 um 12.00.32.png

I used the code based on the example above and implemented this in my large application (inside some mx and spark components). The map is also inside a mx.containers.ViewStack. (the ViewStack where the event can not converted from spark to mx IndexChangeEvent)

Unfortunately, I can not submit you my full application source code. But here is the debug output.

Bildschirmfoto 2014-09-18 um 12.01.37.png

Bildschirmfoto 2014-09-18 um 12.01.17.png

Here is the full debug output text:

TypeError: Error #1034: Type Coercion failed: cannot convert spark.events::IndexChangeEvent@242e4a971 to mx.events.IndexChangedEvent.

  at flash.events::EventDispatcher/dispatchEventFunction()

  at flash.events::EventDispatcher/dispatchEvent()

  at mx.core::UIComponent/dispatchEvent()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/core/UIComponent.as:13682]

  at com.esri.ags.components::ContentNavigator/set selectedIndex()

  at com.esri.ags.components::ContentNavigator/next()

  at com.esri.ags.components::ContentNavigator/nextButton_mouseUpHandler()

It seems that a click on the arrow in the InfoWindow dispatches a spark.events::IndexChangeEvent to the InfoWindow and all parent components but the mx.containers.ViewStack (which is a parent of my map) don't understand a spark.events::indexChangeEvent and want a mx.events.IndexChangeEvent.

I think the IndexChangeEvent doesn't have to be dispatched to all the parent components.

Maybe someone can help.

Thanks

Marcus Fritze

0 Kudos
5 Replies
MarcusFritze
Deactivated User

here the code of my implementation inside a component in my application:

<s:NavigatorContent width="100%" height="100%>

<s:HGroup width="100%" height="100%>

<s:VGroup width="100%" height="100%">

<s:Group width="100%" height="100%">

  <esri:Map id="map" wrapAround180="true" level="4" doubleClickZoomEnabled="false"

    load="{onMapReady()}" mapMouseDown="{onMapMouseDown(event)}" click="{onMapMouseClick()}" zoomStart="{onMapZoomStart()}">

  <esri:ArcGISTiledMapServiceLayer show="{layerShowHandler(event)}" visible="{bb.selectedIndex == 0}"

  url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer"/>

  <esri:ArcGISTiledMapServiceLayer show="{layerShowHandler(event)}" visible="{bb.selectedIndex == 1}"

  url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>

  <esri:ArcGISTiledMapServiceLayer show="{layerShowHandler(event)}" visible="{bb.selectedIndex == 2}"

  url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Imagery/MapServer"/>

  <esri:ArcGISTiledMapServiceLayer show="{layerShowHandler(event)}" visible="{bb.selectedIndex == 2}"

  url="http://server.arcgisonline.com/ArcGIS/rest/services/Reference/World_Boundaries_and_Places/MapServer"/>

  <esri:ArcGISTiledMapServiceLayer show="{layerShowHandler(event)}" visible="{bb.selectedIndex == 2}"

  url="http://services.arcgisonline.com/ArcGIS/rest/services/Reference/World_Transportation/MapServer"/>

  <esri:ArcGISTiledMapServiceLayer show="{layerShowHandler(event)}" visible="{bb.selectedIndex == 3}"

  url="http://server.arcgisonline.com/ArcGIS/rest/services/World_Topo_Map/MapServer"/>

  <esri:GraphicsLayer id="mapGraphicsLayer" symbol="{googleMarkerNormal}" clusterer="{mapClusterer}">

  <esri:infoWindowRenderer>

  <fx:Component>

  <esri:LabelDataRenderer label="NEUER TEST">

  <s:VGroup>

  <s:Label text="TEST"/>

  </s:VGroup>

  </esri:LabelDataRenderer>

  </fx:Component>

  </esri:infoWindowRenderer>

  </esri:GraphicsLayer>

  </esri:Map>

  <s:ButtonBar id="bb"

  right="5" top="5"

  requireSelection="true">

  <s:dataProvider>

  <s:ArrayList>

  <fx:String>Karte</fx:String>

  <fx:String>Satellit</fx:String>

  <fx:String>Hybrid</fx:String>

  <fx:String>Gelände</fx:String>

  </s:ArrayList>

  </s:dataProvider>

  </s:ButtonBar>

  </s:Group>

  </s:VGroup>

</s:HGroup>

</s:NavigatorContent>

0 Kudos
MarcusFritze
Deactivated User

when I click the second time on the same cluster or even when I click 2 times on the same marker the app also crashes with:

TypeError: Error #1034: Type Coercion failed: cannot convert spark.events::IndexChangeEvent@190c56741 to mx.events.IndexChangedEvent.

  at flash.events::EventDispatcher/dispatchEventFunction()

  at flash.events::EventDispatcher/dispatchEvent()

  at mx.core::UIComponent/dispatchEvent()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/core/UIComponent.as:13682]

  at com.esri.ags.components::ContentNavigator/set selectedIndex()

  at com.esri.ags.components::ContentNavigator/set dataProvider()

  at com.esri.ags.handlers::InfoWindowRendererHandler/showInfoWindow()

  at com.esri.ags.handlers::InfoWindowRendererHandler/processClientGraphics()

  at com.esri.ags.handlers::InfoWindowRendererHandler/map_clickHandler()

  at flash.events::EventDispatcher/dispatchEventFunction()

  at flash.events::EventDispatcher/dispatchEvent()

  at mx.core::UIComponent/dispatchEvent()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/core/UIComponent.as:13682]

  at com.esri.ags.layers.supportClasses::LayerContainer/dispatchMapMouseEvent()

  at com.esri.ags.layers.supportClasses::LayerContainer/timerCompleteHandler()

  at flash.events::EventDispatcher/dispatchEventFunction()

  at flash.events::EventDispatcher/dispatchEvent()

  at flash.utils::Timer/tick()

0 Kudos
MarcusFritze
Deactivated User

info: the mentioned mx.containers.ViewStack (event.currentTarget in the first post) is the this.parentDocument.owner from my map component

0 Kudos
MarcusFritze
Deactivated User

Related to this issue, I uploaded some files where you can see this error (exactly not the same, but a similar)

PopUpBug.mxml

PopUpBugFenster.mxml

PopUpBug.swf

It's nearly impossible to use this map in a larger business application!!!

0 Kudos
MarcusFritze
Deactivated User

When I close the InfoWindow of the Symbol by clicking on the Close-Button of the InfoWindow, I get the following error when I debug my application:

TypeError: Error #1034: Type Coercion failed: cannot convert flash.events::Event@16a51a431 to mx.events.CloseEvent.

  at flash.events::EventDispatcher/dispatchEventFunction()

  at flash.events::EventDispatcher/dispatchEvent()

  at mx.core::UIComponent/dispatchEvent()[/Users/justinmclean/Documents/ApacheFlex4.12.0/frameworks/projects/framework/src/mx/core/UIComponent.as:13682]

  at com.esri.ags.components::ContentNavigator/close()

  at com.esri.ags.components::ContentNavigator/closeButton_clickHandler()

0 Kudos