on 09-04-2013 8:32 PM
I have a table bound to a Gateway service. The service returns the values I want, but in UI5 the table repeats rows and doesn't iterate through the results that the service returns. When first loaded, the entire table shows the same row. It will change to a new row when scrolled, but it's quirky.
Here is one of the columns of the table:
var oTable = new sap.ui.table.Table({
visibleRowCount: 20,
firstVisibleRow: 0,
selectionMode : sap.ui.table.SelectionMode.None
});
oTable.addColumn(new sap.ui.table.Column({
label : new sap.ui.commons.Label({
text : "Field"
}),
template : new sap.ui.commons.TextView({
text : "{Ftext}"
})
}));
And here is the binding:
var sUrl = "/sap/opu/odata/sap/Z_RG7_SRV/";
var oModel = new sap.ui.model.odata.ODataModel(sUrl);
oTable.setModel(oModel);
var oFilter = new sap.ui.model.Filter("Objectid", sap.ui.model.FilterOperator.EQ, "8000000215");
oTable.bindRows("/ChangeLogSet", null, null, [oFilter]);
Any ideas?
Hi Ryan,
You have to do bindProperty in the template you are using.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Sharique,
Putting {Ftext} as the value of the text attribute (text: "{Ftext}") does the same thing. Ftext is the name of the value coming from the service (https://sapui5.hana.ondemand.com/sdk/docs/guide/BindingAggregations.html).
In any case, using either produces the same results.
Hi Ryan.
I've had the same issue. It turned out that the problem relates to the keys in the entity I used for a Gateway service. I'll try to explain on my example.
I had an entity with for fields: ID, pernr, name, text. At first the only key field was ID. When the service had to return the following rows:
ID pernr name text
1 123 name1 text1
1 234 name2 text2
In the table two duplicates on the first row were show though when testing the service both rows were returned.
So I add marked pernr as the second key and that helped.
| User | Count |
|---|---|
| 3 | |
| 3 | |
| 2 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.