Skip to Content
0

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

Dec 06, 2017 at 03:42 AM

25

avatar image
Former Member

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?

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

0 Answers