0

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?

Mosh Feu
  • 28,354
  • 16
  • 88
  • 135
  • Error :uncaught TypeError: callback is not a function - this is the error I am getting. I think retrieveWorklists method expectiing callback method as one of parameter from calling. so how to handle this type of cases. retrieveWorklists method is framework code and I cant change it. – user2635390 Jan 23 '16 at 16:35
  • What's the structure of role1 and role2 object . retrieveWorklists must be a function of role1 | 2 – Bourbia Brahim Jan 24 '16 at 14:33
  • 1
    we would need to know how retrieveWorklists is contructed, does it use promises, because dojo.all is to wait for two deferreds to come back – tik27 Jan 25 '16 at 16:09

0 Answers0