javascript - Uncaught Error : no data returned for views/AgeTypes.fragment.xml

标签 javascript popover sapui5

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

在我的 Controller 中:

//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();
    }
}

最奇怪的是我能够打开这个响应式弹出窗口几分钟或更长时间。在那之前,我可以正确打开和关闭它,但几分钟后我无法打开它,并且出现 未捕获错误:没有为 .../views/AgeTypes.fragment.xml 返回数据 错误。我用谷歌搜索了它,但找不到任何有用的信息。

最佳答案

我正在测试,如果您在 Chrome 48.0.2564.97 中使用 UI5 应用之前打开 Gmail 帐户,则 x.fragment.xml 不会给出错误。

关于javascript - Uncaught Error : no data returned for views/AgeTypes.fragment.xml,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33431066/

相关文章:

javascript - Angular js 文件保护程序用于从数据表导出

javascript - 如何使文本区域与表格对齐并检索表格的高度

ajax - 从 Google Analytics 跟踪 Ajax Popover 中的页面

odata - 由于来自 https ://services. odata.org 不支持 CORS 的服务,加载 `$metadata` 失败

javascript - FileUploader 的 uploadComplete-Event 的响应未定义

javascript - Safari 和 Chrome 中的 iframe 问题

javascript - 内联 CKEditor 工具栏没有 h2 元素的对齐按钮

ios - 使用 UIPopoverPresentationController 在 iPhone 上的 Popover 演示

ios - 当 iPad 应用程序进入后台时关闭弹出窗口

javascript - 如何使用 Jquery 在 Sap UI5 中为边框着色