【问题标题】:SAPUI5 Semantic Page, button in footer contentSAPUI5语义页面,页脚内容中的按钮
【发布时间】:2018-09-06 09:44:03
【问题描述】:

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

对于涉及片段和嵌套视图的场景,您的项目必须 包含类似 index.html 或 localIndex.html 的文件,其中包含 data-sap-resourceroots 属性。目前,您的项目没有 包含此类文件。在负缓存中找到: 'sap/f/semantic/customFooterContent.js' 来自 https://sapui5.hana.ondemand.com/1.56.4/resources/sap/f/semantic/customFooterContent.js: 对于涉及片段和嵌套视图的场景,您的项目必须 包含类似 index.html 或 localIndex.html 的文件,其中包含 data-sap-resourceroots 属性。目前,您的项目没有 包含此类文件。

以下是我的页面代码

<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】:

    使用的 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>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2012-10-17
      • 1970-01-01
      • 1970-01-01
      • 2017-07-06
      • 1970-01-01
      • 1970-01-01
      • 2016-05-02
      • 2011-08-06
      相关资源
      最近更新 更多