Monday, 19 February 2024

test ganaral binding(testing )

 



/home/user/projects/project1/webapp/model/record.json:

{
    "text": "outer text",
    "myrecorsd": [
        {
            "text": "text"
        },
        {
            "text": "text2"
        },
        {
            "text": "text3"
        }
    ]
}

/home/user/projects/project1/webapp/view/View1.view.xml:

 <List items="{/myrecorsd}">
    <StandardListItem title="{text}" />
</List>
 <List items="{/myrecorsd}">
    <StandardListItem title="{/text}" />
</List>
<List items="{myrecorsd}">
    <StandardListItem title="{/text}" />
</List>
<List items="{myrecorsd}">
    <StandardListItem title="{text}" />
</List>

/home/user/projects/project1/webapp/controller/View1.controller.js:
  onInit: function () {
                // JSON model first....
                var json = new sap.ui.model.json.JSONModel("model/record.json");
                //Setting model to view...
                this.getView().setModel(json);
                this.getView().bindElement("/");
            }

output:





test ganaral binding(testing )

  /home/user/projects/project1/webapp/model/record.json: {     "text" : "outer text" ,     "myrecorsd" : [    ...