[Solved] Converting ODataModel into JSON Model


As your code seems really unclear, here’s a pointer on how you could implement it:

You read the OData response into a JSONModel:

var oModel2 = new sap.ui.odata.ODataModel();
var oODataJSONModelDLSet = new sap.ui.json.JSONModel();

this.getView().setModel(oODataJSONModelDLSet, "jsonmodel");

// etc

oModel2.read("/SEARCH_DLSet" + filterString, null, null, false, function (oData, oResponse) {
    oODataJSONModelDLSet.setData({ DLSet: oData });
});

…you then bind to your view:

<t:Table rows="{jsonmodel>/DLSet/results}">
    <t:columns>
        <t:Column>
            <Label text="Kontrakt Nr." /> 
            <t:template >
                <commons:TextField value="{jsonmodel>KontraktNr}" />
            </t:template>                   
        </t:Column>

EDIT: Updated answer based on updated question

13

solved Converting ODataModel into JSON Model