SAPUI5 Walkthrough 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)
