on 02-04-2014 2:40 PM
I am trying to bind an OData Service to a sap.m.Table using bindItem method as follows:
closingBalanceTable.bindItems("/CreditSocietyStatementSet('2014')",new sap.m.ColumnListItem({
cells: [
new sap.m.Text({
text : "{TotContriOpenBal}"
}),
new sap.m.Text({
text : "{TotContriOpenBal}"
})
]
}));
its throwing following error:
{"error":{"code":"005056A509B11EE1B9A8FEC11C23378E","message":{"lang":"en","value":"System query options '$orderby,$skip,$top,$skiptoken,$inlinecount,' are not allowed in the requested URI"}}}
OData Service returns only single element as follows response:
<content type="application/xml">
<m:properties>
<d:IFyear>2014</d:IFyear>
<d:TotContriCloseBal>53726.00</d:TotContriCloseBal>
<d:TotContriDepContri>0.00</d:TotContriDepContri>
<d:TotContriOpenBal>53726.00</d:TotContriOpenBal>
<d:UnitCode/>
</m:properties>
</content>
Rauf,
As Jason said you should change your URI to "/CreditSocietyStatementSet" from "/CreditSocietyStatementSet('2014')"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Table's items/rows can only be bound to a collection. As Jason said, if you expect to show only one entry, then it will not be in a table isn't it? If you think you are going to get more entries, then ask the OData service team to return the same entry for /CreditSocietyStatementSet as well, so that you can use it for binding.
Other workound which I do not recommend is to store the output into a Json array and bind the table with that.
Hi Krishna
As Jason and you are suggesting I will try binding with other control,but can you please explain how to store the output into a JSON array/object.Till now I am binding entity sets with controls I have not handled the entity set response in any way If you how to store the response then that will be very helful for me in my future developments.
Any exmaple links?
Hi,
Looks like your oData service is returning an individual entity, rather than an entityset, the orderby etc can only be used against an entity set.
Regards,
Jason
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
6 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.