BTT Web2 iWindow framework provides two kinds of Event mechanism scope: in, out.
The default scope value is Out. For example: Fire event in widget .JS file:
this.iContext.fireEvent('testEvent11',true , "test" );
Listen event in widget .JS file or XML file:
this.iContext.addEventListener('testEvent11',false, this.testListener, this); …. this.testListener = function(aa) { alert(aa); alert('1Listen to the event success!'); //other acions. }
API:
Parameter | Value |
---|---|
Id | The event id, mandatory. |
Scope | The event scope, default value is false, means out. |
Parameter | The parameter string. |
Parameter | Value |
---|---|
Id | The event id, mandatory. |
Scope | The event scope, default value is false, means out. |
Handler | The event handler. |
Following chart show the result of different event scope mechanism for the widget in the same/different widget window:
Fire\Listen | In | Out |
---|---|---|
In | success | failed |
Out | failed | success |
Fire\Listen | In | Out |
---|---|---|
In | failed | failed |
Out | failed | success |