-2
使用路由时,我无法将我的上下文绑定到sap.m.table。在SplitApp,当我点击主页面线项目,采用SAPUI5使用上下文路由显示没有数据
contextarg = decodeURIComponent(evt.getParameter("arguments").ctx);
现在我浏览到详细信息页面和上下文,我已经过了使用
var url = "***/sap/opu/odata/SAP/ZFIRST_VENDOR_SRV";
var olineOdataModel = new sap.ui.model.odata.ODataModel(url,false);
var rd = contextarg+ "/VENDORITEMSSet";
olineOdataModel.read(rd,
null,
null,
false,
function(oData, oResponse){
var oODataJSONModel = new sap.ui.model.json.JSONModel();
oODataJSONModel.setData(oData);
// store the model
var lineTable = sap.ui.getCore().byId("__xmlview5--lineItemTable");
lineTable.setModel(oODataJSONModel,"localModel");
console.log(lineTable.getModel("localModel"));
控制台这个参数去OData的显示输出作为
,我已经照
与表结合<Table id="lineItemTable" headerText="Line Items" items="{'/results'}">
<columns>
<Column>
<header>
<Label text="Product ID" />
</header>
</Column>
<Column>
<header>
<Label text="Product Name" />
</header>
</Column>
<Column>
<header>
<Label text="Product Price" />
</header>
</Column>
<Column>
<header>
<Label text="Product Weight (gms)" />
</header>
</Column>
<Column>
<header>
<Label text="Available From" />
</header>
</Column>
</columns>
<ColumnListItem>
<cells>
<ObjectIdentifier title="{ProductId}" />
<ObjectIdentifier title="{ProductName}" />
<ObjectIdentifier title="{ProductPrc}" />
<ObjectIdentifier title="{ProductWt}" />
<ObjectIdentifier title="{AvailableFrom}" />
</cells>
</ColumnListItem>
</Table>
但是我在视图中没有数据。我试过items="{'results'}"
和items="{path:'results'}"
。请帮助。我在这里做了什么错误?!