Sometimes you have many page instance that have the same criteria ,but handling it in the normal way, it can be handled just 1 instance that is the first instance according to the document
the document I have mentioned above teach you how to handle multi-instance using event , when new app instance started , the START event triggered and set that new app instance to default application instance to be used in running scenario. example code from official document show below
MyAppli.step({ stStart: function(ev, sc, st)
{
MyAppli.start();
MyAppli.events.START.on(function(ev)
{
// filter MyAppli instances other than ev.appliInst for the current scenario
sc.setDefaultInst(ev) ;
});
}});
But what if you want to handle Multi-Instance at the same time. so you have to get all App or Page instance id and handle it with each instance id, just like you use in tester tab in debug tool.
myApplication.instances;
{
"0": {
"ctxType": "ctx.application",
"name": "myApplication",
"instance": 0,
"data": {
"ctxType": "ctx.dataClass",
"appliName": "myApplication",
"appliInst": 0
}
},
"10001": {
"ctxType": "ctx.application",
"name": "myApplication",
"instance": 10001,
"data": {
"ctxType": "ctx.dataClass",
"appliName": "myApplication",
"appliInst": 10001
}
},
"10003": {
"ctxType": "ctx.application",
"name": "myApplication",
"instance": 10003,
"data": {
"ctxType": "ctx.dataClass",
"appliName": "myApplication",
"appliInst": 10003
}
},
"10005": {
"ctxType": "ctx.application",
"name": "myApplication",
"instance": 10005,
"data": {
"ctxType": "ctx.dataClass",
"appliName": "myApplication",
"appliInst": 10005
}
},
}
var instanceKeys = Object.keys(appInst)
// ["0", "10001", "10003", "10005"]
myApplication[instanceKeys[0]].myPage.myItem.get();
Google.pGoogle.events.LOAD.on(
function(){
var inst = Object.keys(Google.instances)
var prevID = appKeys[inst.length-2];
if(Google[prevID]){
Google[prevID].pGoogle.close();
}
}
)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
9 | |
7 | |
4 | |
4 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |