[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 181
  • Last Modified:

Swiz Mediate

hi guys

I have a situation am rendering a textarea (component AutoPopupTextArea) and under the text box i am rendering a datagrid (component CustomGrid )

This is the AutoPopupTextArea code which gets called first
public class AutoPopupTextArea extends FormItem  
{
public function AutoPopupTextArea()  {
super();
textArea = new TextArea();
addChild(textArea);            
Swiz.dispatchEvent(new GlobalScreenEvent(GlobalScreenEvent.EMAIL_LOOKUP));  // 1.this is invoked                        
      }      
}

[Mediate(event="ScreenEvent.DATA_RECEIVED", properties="data")]
public function populateData( data:Object ):void{
if (lookUp) {
lookUp.myCollection = data as ArrayCollection; //but in never comes here      
    }
}
}


Next this component is called
public class public class CustomGrid extends VBox  
{
            
public function CustomGrid()  {
super();
grid = new AdvancedDataGrid();
Swiz.dispatchEvent(new GlobalScreenEvent(GlobalScreenEvent.EMAIL_LOOKUP));  //this is invoked                        
      }      
}

[Mediate(event="ScreenEvent.DATA_RECEIVED", properties="data")]
public function populateData( data:Object ):void{
if (lookUp) {
lookUp.myCollection = data as ArrayCollection; //This is invoked                  
}
}
}
so what happens is Swiz.dispatchEvent from AutoPopupTextArea is invoked but populateData() in never invoked in AutoPopupTextArea , instead populateData()  is invoked in CustomGrid.

Any idea why populateData() in not invoked in AutoPopupTextArea but populateData()  is invoked in CustomGrid?


Thanks
0
royjayd
Asked:
royjayd
1 Solution
 
dgofmanCommented:
did you create a controller
0

Featured Post

What Security Threats Are We Predicting for 2018?

Cryptocurrency, IoT botnets, MFA, and more! Hackers are already planning their next big attacks for 2018. Learn what you might face, and how to defend against it with our 2018 security predictions.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now