Skip to Content
0

SAPUI5 How to setValue in sap.m.Table

May 14 at 10:07 PM

44

avatar image

Hi,

I have an SAPUI5 table.

<Table id="idProductsTable" inset="false" mode="MultiSelect" selectionChange="onInvoiceSelectionChange" items="{ path: '/value', sorter: { path: 'DocNum' } }">

I need to set the a value in the table for a row that has just been seletcted.

var oCtx = oEvent.getSource().getSelectedItem().getBindingContext();
amount = oCtx.getProperty("DocTotal");
oCtx.setProperty("U_JC1_Amount", amount, false); (FAILS - "is not a function")

The setProperty option fails, thought is listed as an option in the documentation.

What is the correct way to set the value of a column in a table for the currently selected row?

Thanks.

Regards,

Mel

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

1 Answer

Best Answer
Srikanth KV May 14 at 10:20 PM
0

Binding context never has the method 'setProperty'

you need to change the value by accessing the model.getPath().setProperty()

Show 1 Share
10 |10000 characters needed characters left characters exceeded

Thanks, Srikanth

Setting the model property worked once I got the path correct.

oModel.setProperty(path + "/U_JC1_Amount", amount, false);

Regards,

Mel

0