Skip to Content
0

SAPUI5 Binding list of comboboxes values from a different json tree than the selectedKey binding

May 09 at 01:31 PM

61

avatar image

Hello all,
let us assume that we have a json with two trees of values. One tree, let's call it T_DATA contains the information of selected keys for the comboboxes, T_CELLS contain the items for the comboboxes lists.

There would be no problem if the combobox items were in the same tree with the selected key binding, but I can't change the json. Is this data binding possible?

oTable.addColumn(new sap.ui.table.Column({
label: new sap.m.Label({text: "Example"}),
template: new sap.m.ComboBox({
selectedKey: "{SALESORG}",
items: {
path: "???",
template: new sap.ui.core.ListItem({
key: "{V_KEY}",
item: "{V_VALUE}"
})
}
})
}));
oTable.bindRows("/T_DATA");

Thanks a lot!

binding2.jpg (62.8 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
Srikanth KV May 10 at 04:31 PM
0

check out this jsbin example below...

http://jsbin.com/weluxof/edit?html,output

Changed sap.ui.table.Table to sap.m.Table

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

Thanks a lot! That's it!

0
Srikanth KV May 09 at 09:10 PM
0

use factory function...

Bind the table to T_DATA then in the factory function during the template creation access T_CELLS to perform binding to combobox.

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

Thanks a lot, please have a look at the post below.. I have made a jsbin example, thanks!

0
Miroslav Sedlar May 10 at 09:27 AM
0

I have made a jsbin example.

http://jsbin.com/yihewacipa/1/edit?html,output

This

path: "/T_CELLS/0/T_CELLS/0/T_DDLB",

must be changed.. the first 0 is hardcoded row number and the second 0 means that there can be more comboboxes on the same row.. so the factory function must somehow take into account only those items with the corresponding V_FIELDNAME, but I think I will be able to do this.. The first 0 is somehow impossible for me to solve :-(

thanks!

Share
10 |10000 characters needed characters left characters exceeded