flex-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Deepak MS <megharajdee...@gmail.com>
Subject Re: Callout contents issue
Date Tue, 23 Sep 2014 09:56:19 GMT
Here's the screenshot of the issue I'm facing.

http://snag.gy/8r4Ha.jpg

I have also tried to come up with sample example:

<?xml version="1.0" encoding="utf-8"?>
<s:View xmlns:fx="http://ns.adobe.com/mxml/2009"
        xmlns:s="library://ns.adobe.com/flex/spark" title="Home"
currentState="loggedOut" >

    <s:layout>
        <s:VerticalLayout />
    </s:layout>

    <fx:Script>
        <![CDATA[

            private var USER_IDLE_TIME:int = 5;//seconds
            private var timer:Timer;
            protected function button1_clickHandler(event:MouseEvent):void
            {
                currentState = 'loggedIn';
                timer = new Timer(1000);
                timer.addEventListener(TimerEvent.TIMER, logoutUser);
                timer.start();
            }

            private var count:int = 0;
            private function logoutUser(event:TimerEvent):void
            {
                count++;

                if(count == USER_IDLE_TIME)
                {
                    count = 0;
                    timer.stop();
                    timer.removeEventListener(TimerEvent.TIMER, logoutUser);
                    timer = null;

                    currentState = 'loggedOut'; //if call out contents are
open, it will keep floating the callout contents on the screen even if we
change the state.
                }
            }
        ]]>
    </fx:Script>

    <s:states>
        <s:State name="loggedOut"/>
        <s:State name="loggedIn"/>
    </s:states>

    <s:Button label="Login" click="button1_clickHandler(event)"
              visible.loggedOut="true" includeInLayout.loggedOut="true"
              visible.loggedIn="false" includeInLayout.loggedIn="false"/>

    <s:CalloutButton label="Dropdown"
                     visible.loggedOut="false"
includeInLayout.loggedOut="false"
                     visible.loggedIn="true"
includeInLayout.loggedIn="true">

        <s:calloutContent>
            <s:List labelField="name">
                <s:dataProvider>
                    <s:ArrayCollection>
                        <fx:Object name="someValue1"/>
                        <fx:Object name="someValue2"/>
                        <fx:Object name="someValue3"/>
                        <fx:Object name="someValue4"/>
                        <fx:Object name="someValue5"/>
                    </s:ArrayCollection>
                </s:dataProvider>
            </s:List>
        </s:calloutContent>
    </s:CalloutButton>
</s:View>



On Wed, Sep 17, 2014 at 2:02 PM, Deepak MS <megharajdeepak@gmail.com> wrote:

> Hello,
> I have ran into this issue when we change the states.
>
> I have defined 2 states. One of the state has a calloutbutton and when
> calloutbutton's callout contents are still active(open) and if we change
> the app's currentstate(user idle time out), the calloutbutton's contents
> are still shown on the screen.
>
> Is that an expected behaviour?
>
> How can we remove the calloutcontent when we change the state?
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message