警告使用新的异步工厂“sap.ui.core.mvc.Controller.create(...)" [英] warning to use new asynchronous factory 'sap.ui.core.mvc.Controller.create(...)'

查看:34
本文介绍了警告使用新的异步工厂“sap.ui.core.mvc.Controller.create(...)"的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

遵循 openui5 教程,但有一些偏差,当我收到以下警告时我提供应用的开发版本:

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

不要为控制器使用同步控制器创建'sap.ui.demo.walkthrough.controller.HelloPanel'!使用新的异步工厂 'sap.ui.core.mvc.Controller.create(...)' 代替.

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.

在 webapp/view/App.view.xml 中,HelloPanel 视图在教程中被引用,即:

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"/>

如果我提供使用 "npm run build:ui" 生成的生产版本我没有看到这个警告.如果我将代码更改为从 CDN 启动,我也看不到它.

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.

我已将本地 UI5 安装更新为与 CDN 中相同的版本(现在为 1.80),但这没有帮助.

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?

推荐答案

构造函数被上面的 mvc:XMLView 行隐式调用.

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

类 sap.ui.core.mvc.XMLView 没有自己的设置,但是来自基类 sap.ui.core.mvc.View 的所有设置都可以与构造函数一起使用.

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.

其中包括异步" 并将其设置为true";删除警告,如下所示:

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

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

这篇关于警告使用新的异步工厂“sap.ui.core.mvc.Controller.create(...)"的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆