Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium

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

Swiz.dispatchEvent not working

higuys

I am using SWIZ framework. I have my code like this

public class AutoPopulate {

public var tradeLookUp : TradeDatagrid = new TradeDatagrid() ;      
public function AutoPopulate()  {
super();
Swiz.dispatchEvent(new GlobalEvent(GlobalEvent.POPULATE_TRADE_LOOKUP));
}


[Mediate(event="GlobalEvent.TRADE_LOOKUP_DATA_RECEIVED", properties="data")]
public function populateLookUp( data:Object ):void{
tradeLookUp.serviceCollection = data as ArrayCollection;
}
}


Swiz.dispatchEvent  is dispatching the event but populateLookUp function is never invoked.


Any idea whats the problem?

thanks
0
royjayd
Asked:
royjayd
  • 2
  • 2
2 Solutions
 
dgofmanCommented:
@royjayd,
Millions reason why you cannot get a result. Server connectivity, invalid result format, backend errors, listeners was not added. How experts can help with your small code implementation?
0
 
royjaydAuthor Commented:
can you point me to a good SWIZ tutorial?  thanks.
0
 
royjaydAuthor Commented:
I am new to SWIZ and looking at some one else code, so plz bear with me.
I want to know exactly what happens when this line is invoked
>>Swiz.dispatchEvent(new GlobalEvent(GlobalEvent.POPULATE_TRADE_LOOKUP));

public function GlobalEvent(type:String,  data:Object = null,callback:Function = null) {
super(type, true);
this.data = data;
this.callback = callback;
}
0
 
dgofmanCommented:
0
 
petiexCommented:
Mediate is a custom meta-tag in the Swiz framework, so you have to tell the compiler about it with the following setting:

-keep-as3-metadata +=Autowire,Mediate

Open in new window


http://danorlando.com/?p=226
0

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

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