Quantcast
Channel: SCN: Message List
Viewing all articles
Browse latest Browse all 3548

how to update table or model on button click

$
0
0

I have one table on hana DB, exposed it as xsodata service

service  {    "schema"."table" as "OrderItem";  }

showing the in ui5 app as

var Model = new sap.ui.model.json.JSONModel("../../services/myexp.xsodata/OrderItem", false);
sap.ui.getCore().setModel(Model,'myitem');
var oTemplate = new sap.m.ColumnListItem({        cells : [            new sap.m.Text({                text : "{myitem>Component}"            }),            new sap.m.Text({                text : "{myitem>Customer}"            }),            new sap.m.Text({                text: "{myitem>Required Date}"            }),            new sap.m.Text({                text : "{myitem>Status}"            })        ]    });
oTable.bindItems("myitem>/d/results", oTemplate);

Working fine

Untitled.png

Now as in image I have two buttons added at the page footer as

footer: new sap.m.Bar({                contentRight: [                    new sap.m.Button({                    text: "Accept",                    type: sap.m.ButtonType.Accept                  }),                new sap.m.Button({                    text: "Reject ",                    type: sap.m.ButtonType.Reject ,                   })                ]
})

now my question is how to update the Status column on click of any button, say If i press accept status will change to accepted and same with reject. (updating the model. I guess hana table will automatically update as tyhe table is expossed as odata model)

 

note this table will have only one row.

 

Thank you


Viewing all articles
Browse latest Browse all 3548

Trending Articles