on ‎2023 Mar 09 3:13 PM
Hi Experts,
I have a JSONModel as below . I have a table with two sap.m.Select controls and after select in the first one, I would like to have the values in the second one updated. Here the first select will have the text1, text2 and if we select text1 the next select will have text1.1, text1.2 So how can I dynmicaly bind the values of the second select to the correct row.Tried the below in the change event of first select, but doesnot work. How this aggregation can be properly bound?

model =
[{
"key": "key1",
"text": "text1",
"values": [{
"key": "key1.1",
"text": "text1.1"
}, { "key": "key1.2", "text": "text1.2" }] }, { "key": "key2", "text": "text2", "values": [{ "key": "key2.1", "text": "text2.1" },{ "key": "key2.2", "text": "text2.2" }] }]
Request clarification before answering.
var oBindingCtx=oEvent.getParameters("selectedItem").getBindingContext("model")
this.byId("select2").setBindingContext(oBindingCtx);
this.byId("select2").bindAggregation("items",{
path:"model>values",
template:.......
})
if it is standalone, it should work.
but in your case, you have table, this.byId("select2") it won't give you the dropdown in that cell
probably you have to do
oEvent.getSource().getParent().....then get all cells --->get the target cell
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.