You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@flex.apache.org by Deepak MS <me...@gmail.com> on 2014/09/17 10:32:36 UTC

Callout contents issue

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?

Re: Callout contents issue

Posted by piotrz <pi...@gmail.com>.
I am not sure whether CalloutButton will belong to the parent component. You
have to probably say includIn="yourstate".
You could also try to "remember" witch callout button has been opened and
close it if it necessary.

Piotr 



-----
Apache Flex PMC
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Callout-contents-issue-tp8035p8105.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Callout contents issue

Posted by Deepak MS <me...@gmail.com>.
Hi Piotr,
The problem is, I have 7 viewnavigators(views) and each view has 5 - 7
different dropdowns(calloutbuttons). And I wont be sure about which
calloutbutton's dropdown is open (so that I could close it).

Isn't it expected behaviour that the callout contents too should belong to
the same state as it's parent? If that was the case, I think it would have
worked fine.

However, is there anything else I could try to overcome this issue?

On Tue, Sep 23, 2014 at 4:08 PM, piotrz <pi...@gmail.com> wrote:

> Hi Deepak MS,
>
> You could call "closeDropDown" method from CalloutButton class once your
> state has changed or try to dispatch an event new
> DropDownEvent(DropDownEvent.CLOSE))
>
> Piotr
>
>
>
> -----
> Apache Flex Committer
> piotrzarzycki21@gmail.com
> --
> View this message in context:
> http://apache-flex-users.2333346.n4.nabble.com/Callout-contents-issue-tp8035p8103.html
> Sent from the Apache Flex Users mailing list archive at Nabble.com.
>

Re: Callout contents issue

Posted by piotrz <pi...@gmail.com>.
Hi Deepak MS,

You could call "closeDropDown" method from CalloutButton class once your
state has changed or try to dispatch an event new
DropDownEvent(DropDownEvent.CLOSE))

Piotr



-----
Apache Flex Committer
piotrzarzycki21@gmail.com
--
View this message in context: http://apache-flex-users.2333346.n4.nabble.com/Callout-contents-issue-tp8035p8103.html
Sent from the Apache Flex Users mailing list archive at Nabble.com.

Re: Callout contents issue

Posted by Deepak MS <me...@gmail.com>.
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 <me...@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?
>