IBM WebSphere Multichannel Bank Transformation Toolkit, Version 7.1

Applying event mechanism in Web2.0 iWindow framework

About this task

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:

Table 1. • fireEvent(id, scope, parameter)
Parameter Value
Id The event id, mandatory.
Scope The event scope, default value is false, means out.
Parameter The parameter string.
Table 2. • addEventListener(id, scope, handler)
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:

Table 3. For the two widgets in one widget container
Fire\Listen In Out
In success failed
Out failed success
Table 4. For the two widgets in different widget window
Fire\Listen In Out
In failed failed
Out failed success


Feedback