Note that there are some explanatory texts on larger screens.

plurals
  1. POproblems filtering XMLListCollection
    primarykey
    data
    text
    <p>I'm trying to create some sort of rangking. For this, I'm using a multilevel xml which I create with a php file. </p> <pre><code>&lt;klassement&gt; &lt;reeks&gt; &lt;reeksId&gt;1&lt;/reeksId&gt; &lt;reeksNaam&gt;3de klasse&lt;/reeksNaam&gt; &lt;ploeg&gt; &lt;ploegNaam&gt;Foo&lt;/ploegNaam&gt; &lt;goalsMade&gt;60&lt;/goalsMade&gt; &lt;points&gt;12&lt;/points&gt; &lt;/ploeg&gt; &lt;ploeg&gt; &lt;ploegNaam&gt;bar&lt;/ploegNaam&gt; &lt;goalsMade&gt;10&lt;/goalsMade&gt; &lt;points&gt;2&lt;/points&gt; &lt;/ploeg&gt; &lt;/reeks&gt; &lt;reeks&gt; &lt;reeksId&gt;2&lt;/reeksId&gt; &lt;reeksNaam&gt;3de klasse res&lt;/reeksNaam&gt; &lt;ploeg&gt; &lt;ploegNaam&gt;Foo res&lt;/ploegNaam&gt; &lt;goalsMade&gt;50&lt;/goalsMade&gt; &lt;points&gt;12&lt;/points&gt; &lt;/ploeg&gt; &lt;ploeg&gt; &lt;ploegNaam&gt;bar&lt;/ploegNaam&gt; &lt;goalsMade&gt;40&lt;/goalsMade&gt; &lt;points&gt;8&lt;/points&gt; &lt;/ploeg&gt; &lt;/reeks&gt; &lt;/klassement&gt; </code></pre> <p>And so on, and so on (you get the point) I get the information with httpService in my application. Afterwards I'm putting that information in an XMLListCollection. Now I'm trying to seperate the levels (probably not the right way, but it works). When I debug I can see that those 2 new vars have the right stuff in it, but when I when I say the dataProvider of the datagrid has to be klassementKern I'm getting the error "implicit coercion of a value of type XML to an unrelated type mx.collections:IList"</p> <p>Does someone know why this is and how I can fix this?</p> <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt; &lt;s:NavigatorContent xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" height="600" skinClass="skins.ListContainerSkin" creationComplete="httpKlassement.send()"&gt; &lt;fx:Declarations&gt; &lt;s:HTTPService id="httpKlassement" url="http://localhost/flexScripts/klassement.php" resultFormat="e4x" result="showKlassement(event)"/&gt; &lt;/fx:Declarations&gt; &lt;fx:Script&gt; &lt;![CDATA[ import mx.collections.XMLListCollection; import mx.rpc.events.ResultEvent; [Bindable] private var klassement:XMLListCollection; [Bindable] private var klassementKern:XML; [Bindable] private var klassementReserve:XML; protected function showKlassement(event:ResultEvent):void { klassement = new XMLListCollection(event.result.reeks); klassementKern = klassement[0]; klassementReserve = klassement[1]; } ]]&gt; &lt;/fx:Script&gt; &lt;s:layout&gt; &lt;s:VerticalLayout gap="10" paddingLeft="10" paddingTop="10" paddingRight="10" paddingBottom="10"/&gt; &lt;/s:layout&gt; &lt;s:DataGrid width="760" height="230" dataProvider="{klassementKern}"&gt; &lt;s:columns&gt; &lt;s:ArrayCollection&gt; &lt;s:GridColumn headerText="Ploeg" dataField="ploeg.ploegNaam"/&gt; &lt;s:GridColumn headerText="WG" dataField="ploeg.aantalGespeeld"/&gt; &lt;s:GridColumn headerText="W" dataField="ploeg.aantalGewonnen"/&gt; &lt;s:GridColumn headerText="V" dataField="ploeg.aantalVerloren"/&gt; &lt;s:GridColumn headerText="G" dataField="ploeg.aantalGelijk"/&gt; &lt;s:GridColumn headerText="D+" dataField="ploeg.goalenGemaakt"/&gt; &lt;s:GridColumn headerText="D-" dataField="ploeg.goalenTegen"/&gt; &lt;s:GridColumn headerText="Punten" dataField="ploeg.punten"/&gt; &lt;s:GridColumn headerText="DS" dataField="ploeg.doelpuntensaldo"/&gt; &lt;/s:ArrayCollection&gt; &lt;/s:columns&gt; &lt;/s:DataGrid&gt; &lt;/s:NavigatorContent&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload