Search code examples
dialogsapui5

Dialog box shows blank UI5


I have defined my dialog view as follows. For some reason it gives blank dialog box. If I uncomment the already commented control and comment the entire , then it works fine. I do not understand what is possible problem with the . Same code works for another dialog with the

View.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>

Solution

  • In your button, you're using the custom data namespace, but haven't declared it.

    Add

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

    to the top of your view in the core:FragmentDefinition tag