on 09-29-2015 1:13 PM
Hello,
I have an OData model which looks like this:
In a formatter function I try to access "ContractToResidualCapitals". This actually is a table with several entries and three columns. Unfortunately I cannot access that node in the model. If I use
var test1 = oModel.getProperty("/ContractSet('0000010000850')");
"test1" get's the correct object.
Trying
var test2 = oModel.getProperty("/ContractSet('0000010000850')/ContractCapital");
also leads to the expected result. But if I try
var test3 = oModel.getProperty("/ContractSet('0000010000850')/ContractToResidualCapitals");
"test3" is always "undefined". Furthermore I cannot see the data in the debugger (only "deferred") though they are visible in the UI (via an XML view). The three "ContractTo..." nodes are loaded via an "expand". Maybe that causes the problems.
Does anybody have an idea how to access the data in those three nodes?
Thanks & kind regards,
Marko
ODataModel.prototype.getProperty = function(sPath, oContext, bIncludeExpandEntries)
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Sorry... 😉
The binding is updated in the controller of the view:
// update binding
var sContractPath = "/" + oEvent.getParameter("arguments").contract + " $expand=ContractToAmountSums,ContractToResidualCapitals";
var oHeaderContainer = this.getView().byId("headercontainer");
oHeaderContainer.bindElement(sContractPath);
When formatter function is called, there is not guarantee that the expanded properties will be available in the model as you've haven't bound those to the label. A formatter is supposed to manipulate only the values that is bound to that corresponding control.
As you've said the expanded properties are visible in the UI, where are those bound in the view ? Just try having a formatter to those controls and you'd be able to get the values.
The actual problem is that I need to evaluate the whole model to be able to determine the label values. In my case the minimum and maximum sum and the minimum and maximum date which occurs for the respective contract in the aggregation ContractToAmountSums. The MicroAreaChart seems to be a bit premature regarding the axes labels. I almost can't imagine a use case where they can be set to fixed value... 😉
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.