1

新しい SAPUI5 開発キットで何かしようとしています。試してみたいコードが見つかりましたが、テーブルが常に空です。自分で解いてみましたが、出来ません。これが私のコードです:

var oTable = new sap.ui.table.DataTable();
oTable.setTitle("My Table");
oTable.addColumn(new sap.ui.table.Column({
  label: new sap.ui.commons.Label({text: "Agency Name"}),
  template: new sap.ui.commons.TextView().bindProperty("text", "NAME"),
  sortProperty: "NAME"
}));

// More Columns...
oTable.addColumn(new sap.ui.table.Column({
  label: new sap.ui.commons.Label({text: "Currency"}),
  template: new sap.ui.commons.TextField().bindProperty("value", "CURRENCY"),
  sortProperty: "CURRENCY",
}));

var uri = "http://gw.esworkplace.sap.com/sap/opu/sdata/iwfnd/RMTSAMPLEFLIGHT";
var user = "GW@ESW";
var pw = "ESW4GW";
var oModel = new sap.ui.model.odata.ODataModel(uri,false,user,pw);
oTable.setModel(oModel);
oTable.bindRows("TravelagencyCollection");
oTable.placeAt("dataTable");

このコードをEclipseとWebサーバーで試しましたが、どちらも同じ空のテーブル結果になりました。フラグを付けてクロムでこれを実行するためのヒントを見つけました --disable-web-securityが、それでも何も起こりません。私は何を間違っていますか?


ヒントをありがとう。フラグがないと、401 コードが返されます。フラグを使用すると、200 GET OK が返されますが、テーブルはまだ空です。

またnew sap.ui.commons.TextView({ text: '{key}' })、空のテーブルを取得します。

4

2 に答える 2