Popup message for showing the status

reddys.raghuu's Avatar

reddys.raghuu

16 Aug, 2011 04:02 PM

I have to show a pop up message when event has triggered & i need to delete the same when i got the result. For this am using the below code. Basically in the ViewMediator, onregister creating the popup & on result am deleting the same popup. Please suggest if is the correct way or is there any better way.

package com.flex.robotlegs.views
{

import com.flex.robotlegs.events.UserDetailsEvent;
import com.flex.robotlegs.models.AppModel;
import com.flex.robotlegs.utils.StatusPopUp;
import com.flex.robotlegs.views.components.MainView;

import flash.utils.setTimeout;

import mx.managers.PopUpManager;

import org.robotlegs.mvcs.Mediator;

public class MainViewMediator extends Mediator
{
    [Inject]
    public var mainView:MainView;       

    public var loadingBar:StatusPopUp;

    override public function onRegister():void
    {           
        eventMap.mapListener(eventDispatcher,UserDetailsEvent.USERDETAILS_LOADED,onUserLoaded);
        eventDispatcher.dispatchEvent(new UserDetailsEvent(UserDetailsEvent.LOAD_USERDETAILS));
        loadingBar = new StatusPopUp();
        PopUpManager.addPopUp(loadingBar,contextView);
        PopUpManager.centerPopUp(loadingBar);
    }

    private function onUserLoaded(event:UserDetailsEvent):void
    {                                               
        mainView.userLabel.text = event.userXML.userXML.info.userName.toString();
        PopUpManager.removePopUp(loadingBar);
    }       

}

}

  1. 1 Posted by neil on 17 Aug, 2011 07:57 AM

    neil's Avatar
  2. 2 Posted by reddys.raghuu on 17 Aug, 2011 11:58 AM

    reddys.raghuu's Avatar

    Yeah, i have seen the above URL. Both are almost same except Mediator for the popup which is not required as this popup is temporary & it does not require anymore.

  3. 3 Posted by reddys.raghuu on 06 Sep, 2011 07:34 AM

    reddys.raghuu's Avatar

    How do i close the created popup box in the above code?

    I have created a popup on a mediator & i want to close on a service fault handler.

  4. Support Staff 4 Posted by Ondina D.F. on 02 Nov, 2011 04:40 PM

    Ondina D.F.'s Avatar

    Hey reddys,

    Are you still having this issue?

    Ondina

    [Feel free to reopen this discussion in case you have more questions or you need further assistance with this issue. Please open new threads for new issues.]

  5. Ondina D.F. closed this discussion on 21 Nov, 2011 09:17 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac