cancel
Showing results for 
Search instead for 
Did you mean: 

[UI5 Component]How to let UI5 component init process includes async process

scar
Employee
Employee
0 Kudos

Hi Experts,

I'm writing a component which needs create something in backend services. As the component loaded async. I want to find a way to let component only "ready" when all async backend operation is done.

Code of component

--------

onInit() {

//call a routine with promise.

}

--------

Code in component user

------------------------

var componentPromise = sap.ui.component( { name: xxx

, async: true, settings: { componentData: oData } }

); componentPromise.then(

// I hope when the UI5 says the component is loaded, not the onInit is executed, but several async operation inside the onInit is also returned.

...

------------------------

Is there any trick to let it feasible?

Accepted Solutions (0)

Answers (0)