1. 程式人生 > 其它 >SAPUI5 Walkthrough Step 30: Debugging Tools

SAPUI5 Walkthrough Step 30: Debugging Tools

Step 30: Debugging Tools 除錯 修改webapp/view/InvoiceList.view.xml檔案, 把其中的ExtendedPrice 改為ExTendedPrice
<mvc:View xmlns="sap.m" xmlns:mvc="sap.ui.core.mvc" controllerName="sap.ui.demo.walkthrough.controller.InvoiceList">
    <List id="invoiceList" headerText="{i18n>invoiceListTitle}" class
="sapUiResponsiveMargin" width="auto" items="{ path : 'invoice>/Invoices', sorter : { path : 'ShipperName', group : true } }"> <headerToolbar> <Toolbar> <Title text="{i18n>invoiceListTitle}"
/> <ToolbarSpacer/> <SearchField width="50%" search=".onFilterInvoices"/> </Toolbar> </headerToolbar> <items> <ObjectListItem title="{invoice>Quantity} x {invoice>ProductName}" number="{parts: [ {path: 'invoice>ExTendedPrice
'}, {path: 'view>/currency'} ], type: 'sap.ui.model.type.Currency', formatOptions: { showMeasure: false } }"
numberUnit="{view>/currency}" numberState="{= ${invoice>ExtendedPrice} > 10 ? 'Error' : 'Success' }"> <firstStatus> <ObjectStatus text="{ path: 'invoice>Status', formatter: '.formatter.statusText'}"/> </firstStatus> </ObjectListItem> </items> </List> </mvc:View>

修改後儲存, 執行 mockServer.html檔案,發現金額沒有顯示

同時按下 ctrl+shift+alt+S 開啟 UI5 Diagnostics, 檢視Control Tree中,對應元素的資訊, 可以看到number的path屬性ExTendedPrice (invalid)