我正在使用语义页面开发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>
答案 0 :(得分:2)
使用的sap.f.语义页脚聚合是错误的,应为以下之一
https://sapui5.hana.ondemand.com/#/api/sap.f.semantic.SemanticPage
<!-- Custom Footer Content-->
<semantic:footerCustomActions>
<Button text="Save" />
<Button text="Cancel" />
</semantic:footerCustomActions>