Note that there are some explanatory texts on larger screens.

plurals
  1. POFlex: Why does mouseOut of a DataGroup ItemRenderer cause a state change?
    text
    copied!<p>I've found a very annoying problem with the itemRenderers in a DataGroup in flex 4, when I mouseout of the itemRenderer is returns to its default state. Here's an example:</p> <pre><code>&lt;s:Application xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx"&gt; &lt;s:BorderContainer&gt; &lt;s:DataGroup&gt; &lt;s:layout&gt; &lt;s:VerticalLayout gap="1"/&gt; &lt;/s:layout&gt; &lt;s:dataProvider&gt; &lt;s:ArrayCollection&gt; &lt;fx:Object title="One" /&gt; &lt;fx:Object title="Two" /&gt; &lt;fx:Object title="Three" /&gt; &lt;/s:ArrayCollection&gt; &lt;/s:dataProvider&gt; &lt;s:itemRenderer&gt; &lt;fx:Component&gt; &lt;s:ItemRenderer&gt; &lt;s:states&gt; &lt;s:State name="expanded" /&gt; &lt;s:State name="collapsed" /&gt; &lt;/s:states&gt; &lt;fx:Script&gt; &lt;![CDATA[ private function expandCollapse():void { currentState = (currentState == "collapsed") ? "expanded" : "collapsed"; } ]]&gt; &lt;/fx:Script&gt; &lt;s:VGroup&gt; &lt;mx:Button click="expandCollapse();" label="Click me to hide the number" /&gt; &lt;s:SkinnableContainer&gt; &lt;s:VGroup height="0" height.expanded="NaN"&gt; &lt;s:Label text="{data.title}" /&gt; &lt;/s:VGroup&gt; &lt;/s:SkinnableContainer&gt; &lt;/s:VGroup&gt; &lt;/s:ItemRenderer&gt; &lt;/fx:Component&gt; &lt;/s:itemRenderer&gt; &lt;/s:DataGroup&gt; &lt;/s:BorderContainer&gt; &lt;/s:Application&gt; </code></pre> <p>When the user clicks on the button the VGroup is collapsed as expected, but then if a user moves their mouse out of the item renderer it then collapses, i.e. returns to its default state.</p> <p>Is this a bug or am I missing something here?</p> <p>Cheers,</p> <p>Chris</p>
 

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