how to use dojo.all in case of loops and also requested calls methods expects callback function in their signature

97 views Asked by At

All in my below scenrio, currentroles = [role1, role2];

Currently, the code is like below. (Currently they are independent async xhr calls)

this.currentroles[0].retrieveWorklists(dojo.hitch(this,this.init),true);

this.currentroles[0].retrieveWorklists(dojo.hitch(this,this.init),true);

I want to put these two calls in dojo.all and use the combined results to process the results.

I did something below but getting error

all([this.currentuserroles[0].retrieveWorklists,this.currentuserroles[1].retrieveWorklists]).then(this.init);

Can you please help me how to use in this case?

0

There are 0 answers