SAPUI5语义页面,页脚内容中的按钮

问题描述 投票:0回答:1

我正在使用语义页面开发SAPUI5应用程序。我打算在页面的页脚内容中添加一个按钮。但它显示以下错误

对于涉及片段和嵌套视图的方案,您的项目必须包含index.html like或包含data-sap-resourceroots属性的localIndex.html文件。目前,您的项目不包含负缓存中的这些files.found:来自https://sapui5.hana.ondemand.com/1.56.4/resources/sap/f/semantic/customFooterContent.js的'sap / f / semantic / customFooterContent.js':对于涉及片段和嵌套视图的方案,您的项目必须包含index.html like或localIndex。包含data-sap-resourceroots属性的html文件。目前,您的项目不包含此类文件。

以下是我的页面代码

<semantic:SemanticPage id="ViewCartPage" headerPinnable="false" toggleHeaderOnTitleClick="false" preserveHeaderStateOnScroll="false" showFooter="true">
    <semantic:titleHeading>
            <Button id="continueShoppingButton" press="onContinueShoppingPressed" text="Continue Shopping" type="Transparent"/>
    </semantic:titleHeading>

    <!-- Header Content -->
    <semantic:headerContent>
        <Label class="CartHeader" text="Your Cart"  width="100%" />
        <FlexBox alignItems="Start" justifyContent="SpaceBetween">
            <items>
                <Panel backgroundDesign="Transparent">
                    <content>
                        <core:Icon id="shoppingCartIcon" height="3rem" size="3rem" src="sap-icon://cart" alt="{i18n>xfld.keyWord2}"/>
                    </content>
                </Panel>
                <Panel backgroundDesign="Transparent">
                    <content>
                        <Label text="Customer : " width="100%" id="lbl1_Customer"/>
                        <Label class="OrderContent" text="{/objectDescription/customer}" width="100%" id="lbl2_Customer"/>
                    </content>
                </Panel>
                <Panel backgroundDesign="Transparent">
                    <content>
                        <Label text="Salesperson : " width="100%" id="lbl1_Salesperson"/>
                        <Label class="OrderContent" text="{/objectDescription/salesperson}" width="100%" id="lbl2_Salesperson"/>
                    </content>
                </Panel>
                <Panel backgroundDesign="Transparent">
                    <content>
                        <Label text="Number of Items : " width="100%" id="lbl1_NoOfItems"/>
                        <Label class="OrderContent" text="{/objectDescription/items}" width="100%" id="lbl2_NoOfItems"/>
                    </content>
                </Panel>
                <Panel backgroundDesign="Transparent" class="OrderColumn">
                    <content>
                        <Label text="Total Amount : " width="100%" id="lbl1_TotalAmount"/>
                        <Label class="OrderContent" text="{/objectDescription/amount}" width="100%" id="lbl2_TotalAmount"/>
                    </content>
                </Panel>
                <!--<ObjectStatus text="Continue Shopping" state="{/objectDescription/status}"/>-->
            </items>
        </FlexBox>
    </semantic:headerContent>

    <!-- Content -->
    <semantic:content>
        <Table id="idProductsTable" inset="false" items="{path:'/ProductCollection'}">
            <columns>
                <Column minScreenWidth="Tablet" demandPopin="true">
                    <Text text="Name"/>
                </Column>
                <Column minScreenWidth="Tablet" demandPopin="true">
                    <Text text="Quantity"/>
                </Column>
                <Column minScreenWidth="Tablet" demandPopin="true">
                    <Text text="UOM"/>
                </Column>
                <Column minScreenWidth="Tablet" demandPopin="true">
                    <Text text="Price"/>
                </Column>
                <Column minScreenWidth="Tablet" demandPopin="true">
                    <Text text="Subtotal"/>
                </Column>
                <Column id="buttonColumn" width="15%" minScreenWidth="Tablet" demandPopin="true" popinDisplay="WithoutHeader" hAlign="Right" class="sapMTableContentMargin">
                    <header>
                        <Label id="cartItemDelete" text="Cancel" visible="{= ${device>/system/phone}}"/>
                    </header>
                </Column>
            </columns>
            <items>
                <ColumnListItem vAlign="Middle">
                    <cells>
                        <ObjectIdentifier title="{Name}" text="{ProductId}"/>
                        <Input value="{Quantity}" width="70px"/>
                        <Text text="{UOM}"/>
                        <Text text="{Price}"/>
                        <Text text="{Subtotal}"/>
                        <!-- Add Button -->
                        <Button id="addToCartButton" tooltip="Delete Item" icon="sap-icon://decline" press="deleteCartItemPressed" type="Transparent"/>
                    </cells>
                </ColumnListItem>
            </items>
        </Table>
    </semantic:content>
    <semantic:customFooterContent>
            <Button id="confirmOrder" text="Confirm" press="onConfirmOrder"/>
    </semantic:customFooterContent>
</semantic:SemanticPage>

html sapui5 semantic-ui
1个回答
2
投票

使用的sap.f.semantic页脚的聚合是错误的,它应该是下面的一个

https://sapui5.hana.ondemand.com/#/api/sap.f.semantic.SemanticPage

<!-- Custom Footer Content-->
        <semantic:footerCustomActions>
            <Button text="Save" />
            <Button text="Cancel" />
        </semantic:footerCustomActions>
© www.soinside.com 2019 - 2024. All rights reserved.