'binding data to id of control sap ui5
I am working at binding control using SAP UI5 with object model.
<layout:VerticalLayout content="{oModel>/part2/chartContents}" width="100%">
<layout:fixContent>
<viz:VizFrame id="{oModel>id}" uiConfig="{applicationSet:'fiori'}" vizType='column' >
<viz:dataset>
<viz.data:FlattenedDataset data="{oModel>data/milk}">
<viz.data:dimensions>
<viz.data:DimensionDefinition name="Week" value="{oModel>Week}" />
</viz.data:dimensions>
<viz.data:measures>
<viz.data:MeasureDefinition name="Revenue" value="{oModel>Revenue}" />
<viz.data:MeasureDefinition name="Cost" value="{oModel>Cost}" />
</viz.data:measures>
</viz.data:FlattenedDataset>
</viz:dataset>
<viz:feeds>
<viz.feeds:FeedItem id='valueAxisFeed' uid="valueAxis" type="Measure" values="Revenue" />
<viz.feeds:FeedItem id='categoryAxisFeed' uid="categoryAxis" type="Dimension" values="Week" />
</viz:feeds>
</viz:VizFrame>
</layout:fixContent>
</layout:FixFlex>
</layout:VerticalLayout>
My data model:
var oModel = new sap.ui.model.json.JOSNModel({part2: {chartContents: [{
title: "a. tile 1",
linkText: "detail",
id: "idoChart1
metaData: {
reportName: "first Report",
from: "",
to: ""
},
data: {
"milk": [{
"Week": "Week 1 - 4",
"Revenue": 431000.22,
"Cost": 230000,
"Cost1": 24800.63,
"Cost2": 205199.37,
"Target": 500000,
"Budget": 210000
}]
}
}]}})
this.getView().setModel(oModel, "oModel");
But in property id="{oModel>id}", it does not work, although other properties have the correct value.
Question
How can I bind value (ID) in the object model to control of SAP UI5?
Solution 1:[1]
id="{oModel>/id}"
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Dharman |
