首页 > 解决方案 > 对话框显示空白 UI5

问题描述

我已将我的对话框视图定义如下。由于某种原因,它给出了空白对话框。如果我取消注释已注释的控件并注释整个 ,那么它可以正常工作。我不明白 . 相同的代码适用于另一个对话框

视图.xml

    <core:FragmentDefinition xmlns="sap.m" xmlns:core="sap.ui.core" xmlns:l="sap.ui.layout">
    <Dialog id="editCompanyDialog" contentWidth="800px" contentHeight="100%" afterClose="onCancelEditCompanyDialog"
        busy="{sharedApp>/oBusy/busy}" busyIndicatorDelay="{sharedApp/oBusy/delay}">
        <!--<Toolbar class="modal-header">-->
        <!--    <Text text="Edit Company Information" class="modal-title"/>-->
        <!--    <core:Icon class="modal-logo" src="sap-icon://edit-icon"/>-->
        <!--    <Button text="x" class="btn-link modal-close-button" press="onCancelEditCompanyDialog"/>-->
        <!--</Toolbar>-->
    <subHeader>
            <Toolbar>
                <Text class="sapUiSmallMarginBegin dialogTitle" text="{/headerText}"/>
                <ToolbarSpacer></ToolbarSpacer>
                <Button class="btn-link-grey" custdata:name="maDialog" icon="sap-icon://decline" tooltip="{i18n>GB_Close}" press="onCloseDialog"/>
            </Toolbar>
   </subHeader>
    <Panel>
            <content>
        <l:BlockLayout id="editCompanyBlockLayout">
            <l:BlockLayoutRow>
                <l:BlockLayoutCell>
                    <VBox>
                        <ObjectIdentifier text="Edit your company information"/>
                    </VBox>
                </l:BlockLayoutCell>
            </l:BlockLayoutRow>
            <l:BlockLayoutRow>
                <l:BlockLayoutCell>
                    <VBox>
                        <Label text="{i18n>CC_Company}" labelFor="Name1"/>
                        <Input id="Name1" textAlign="Left" value="{EditCompany>/Input/Name1}" fieldGroupIds="FC"/>
                    </VBox>
                </l:BlockLayoutCell>
            </l:BlockLayoutRow>
 </content>
</Panel>

标签: dialogsapui5

解决方案


在您的按钮中,您正在使用自定义数据命名空间,但尚未声明它。

添加

xmlns:custdata="http://schemas.sap.com/sapui5/extension/sap.ui.core.CustomData/1"

core:FragmentDefinition标签中视图的顶部


推荐阅读