warning to use new asynchronous factory 'sap.ui.core.mvc.Controller.create(…)'

拥有回忆 提交于 2021-02-08 08:24:39

问题


Following the openui5 tutorial with some deviations I get the following warning when I serve the dev version of the app:

Do not use synchronous controller creation for controller 'sap.ui.demo.walkthrough.controller.HelloPanel'! Use the new asynchronous factory 'sap.ui.core.mvc.Controller.create(...)' instead.

In webapp/view/App.view.xml the HelloPanel view is referenced as in the tutorial, that is with:

<mvc:XMLView viewName="sap.ui.demo.walkthrough.view.HelloPanel"/>

If I serve the production build generated with "npm run build:ui" I don't see this warning. If I change the code to boot from the CDN, I also do not see it.

I have updated the local UI5 installation to the same version as in the CDN (now 1.80) but that didn't help.

What is the reason for this warning? Also, is it something I should worry about?


回答1:


The constructor is implicitly called by the mvc:XMLView line above.

Class sap.ui.core.mvc.XMLView does not have its own settings but all those from the base class sap.ui.core.mvc.View may be used with the constructor.

Among them is "async" and setting it "true" removes the warning, like this:

<mvc:XMLView
  viewName="sap.ui.demo.walkthrough.view.HelloPanel"
  async="true"
/>


来源:https://stackoverflow.com/questions/63178520/warning-to-use-new-asynchronous-factory-sap-ui-core-mvc-controller-create

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!