Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8107959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 6, 20262026-06-06T00:56:30+00:00 2026-06-06T00:56:30+00:00

I have a popup window (selectReasonCode) that is opened up from a button. The

  • 0

I have a popup window (selectReasonCode) that is opened up from a button. The button has the following code

var selectReasonCode:SelectReasonCode = new SelectReasonCode();         
selectReasonCode.title = "Reason Codes";
selectReasonCode.showCloseButton = true;
PopUpManager.addPopUp(selectReasonCode, this, true);
PopUpManager.centerPopUp(selectReasonCode);             
selectReasonCode.updateReasons(reasonTypeId, rasonCds);  //This sets the dataprovider 

on the select reason code screen I have a data grid that is populated with the values that is set in the updateReasons method (which is called by the method above.

The thing is that my popup screen opens up empty. But if I add a break point in the code in debug mode and pass it the screen opens up with data. I believe that the screen opens up before the data actually gets set. Can this be true? And if so how can I assure that the update Reasons method gets executed first before the screen opens up?

To exclude debug mode… I added a line after the updateReasons code to cause an error. Hence the error display first, the user clicks ok and then opens the popup. The data display then in the popup.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-06T00:56:33+00:00Added an answer on June 6, 2026 at 12:56 am

    I believe that the screen opens up before the data actually gets set.
    Can this be true?

    Yes!

    And if so how can I assure that the update Reasons method gets
    executed first before the screen opens up?

    Execute the method and don’t display the pop up until after you get data back. Executing in debug mode could give you the pause you need while waiting for data to return from the remote server; depending where the debug point is.

    But, you can just move the updateReasons method call like this:

    var selectReasonCode:SelectReasonCode = new SelectReasonCode();         
    selectReasonCode.title = "Reason Codes";
    selectReasonCode.showCloseButton = true;
    selectReasonCode.updateReasons(reasonTypeId, rasonCds);  //This sets the dataprovider 
    PopUpManager.addPopUp(selectReasonCode, this, true);
    PopUpManager.centerPopUp(selectReasonCode);             
    

    However, under the assumption that updateReasons fires off a asynchronous service call, you’ll have to wait until the data is returned before showing the popup. Conceptually like this:

    // first make your pop up component an instance variable instead of a local variable to the method
    protected var selectReasonCode:SelectReasonCode;         
    
    
    // in your method; create the instance like nromal 
    selectReasonCode:SelectReasonCode = new SelectReasonCode();
    selectReasonCode.title = "Reason Codes";
    selectReasonCode.showCloseButton = true;
    selectReasonCode.updateReasons(reasonTypeId, rasonCds);  //This sets the dataprovider  
    selectReasonCode.addEventListener('someEventThatTellsMeDataIsReturn',onPopUpDataReturn);
    
    
    // finally in your data is available method, display the pop up using the PopUpManager
    protected function onPopUpDataReturn(event:Event):void{
      PopUpManager.addPopUp(selectReasonCode, this, true);
      PopUpManager.centerPopUp(selectReasonCode);             
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a draggable popup window that has a title bar and an iframe
I have a popup window and in that page I have the following code
I have a button that opens a panel in a popup window and then
I have a Java swing application with a button that produces a popup window
I have an application that intends to create a popup window when a button
I have a popup window code that I have used before in login forms.
I have a click function that has a popup window that I need to
i have created a popup window using the following code in javascript; window.open(http://google.com, myWindow,
I have a webpage with a form element and a popup window (opened by
I have a page with two buttons, one Button opens a popup window with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.