【问题标题】:Uncaught Error: no data returned for views/AgeTypes.fragment.xml未捕获的错误:没有为视图/AgeTypes.fragment.xml 返回数据
【发布时间】:2015-10-30 07:51:16
【问题描述】:

我的 AgeTypes.fragment.xml 是这样的:

<core:FragmentDefinition
    xmlns="sap.m"
    xmlns:core="sap.ui.core">

    <ResponsivePopover
        id="popAgeTypes" class="sapUiPopupWithPadding"
        afterClose="onAgeTypesClosed"
        placement="Auto" showHeader="false" >
        <beginButton>
            <Button text="OK" press="onAgeTypeChanged" /> 
        </beginButton>
        <content>

        <List id="ageTypes" mode="MultiSelect"
            includeItemInSelection="true"
            items="{...}">

            <items>...</items>
        </List>
        </content>
    </ResponsivePopover>
</core:FragmentDefinition>

在我看来,有一个按钮可以在按下此弹出框片段时打开它。我的按钮 xml 是:

<m:Button id="ageTypesId" text="Ages" icon="sap-icon://person-placeholder"
                press="onAgeTypeSelect"/>

在我的控制器中:

//this method is triggered when user press button.
onAgeTypeSelect: function(oEvent){
    this.popAgeTypes = sap.ui.xmlfragment( App.ComponentName + ".views.AgeTypes", this);
    this.getView().addDependent(this.popAgeTypes);
    this.popAgeTypes.openBy(oEvent.getSource());
},

//when user select items from responsive popover list item
onAgeTypeChanged: function(oEvent) {
    //taking selected items and doing some business.
    this.popAgeTypes.close();
    this.popAgeTypes.destroy();
},

//and this code is triggered when afterClose method of Responsive popover work
onAgeTypesClosed : function(oEvent){
    if (this.popAgeTypes) {
        this.popAgeTypes.destroy();
    }
}

最奇怪的是我可以打开这个响应式弹出窗口几分钟甚至更长时间。在此之前,我可以正确打开和关闭它,但几分钟后我无法打开它,并且出现 Uncaught Error: no data returned for .../views/AgeTypes.fragment.xml 错误。我用谷歌搜索了它,但找不到任何有用的信息。

【问题讨论】:

  • 你有没有解决这个问题?我目前面临同样的问题...
  • 我不完全记得我在什么情况下得到了这个错误。对此感到抱歉。但现在它正在工作并且工作代码与这些代码几乎相同。确保您编写了正确的列表项路径,并避免重复 id 错误,不要在 xml 中分配 id。并尝试清理缓存。我希望这些解决方案可以帮助到您。
  • 谢谢 - 我会看看这个。经过进一步调查,似乎只有最新的 chrome 版本会引发此错误 - 其他浏览器仍然有效。清除缓存时它以某种方式工作,但只有一次:D
  • 似乎我永远无法理解为什么会出现这些错误或为什么开始工作:p
  • 同样的问题:1.它偶尔会起作用,2.它只发生在Chrome(我的版本:48.0.2564.97 64bit)中,3.开发工具报告Content-Length=1335,Content-Type=application /xml,但是当我查看“响应”选项卡时,它显示“此请求没有可用的响应数据”

标签: javascript popover sapui5


【解决方案1】:

我正在测试,如果您在 Chrome 48.0.2564.97 中使用 UI5 应用程序之前打开您的 gmail 帐户,那么 x.fragment.xml 不会给您错误。

【讨论】:

  • 抱歉,我没有足够的声誉来评论主帖。
【解决方案2】:

我遇到了相同或至少类似的问题。 (未捕获的错误:没有为...返回数据)。就我而言,除了第一次 OPA 测试外,所有测试都失败了。 将我的 Google Chrome 从 48.0.2564.97 更新到 48.0.2564.103 后,问题就消失了。

最好的问候, 塞巴斯蒂安

【讨论】:

    猜你喜欢
    • 2022-01-22
    • 2015-09-27
    • 1970-01-01
    • 2023-03-27
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多