Skip to Content
0

How to pass the selected value from one comboBox to another comboBox inside sap.m.Table?

Dec 08, 2017 at 06:49 AM

182

avatar image

Hi all,

I have an sap.m.Table and four ComboBoxes inside it. The ComboBoxes are placed in such a way that, the value selected from one combobox need to be passed as one of the 'filtervalue ' to the other combobox. I'm able to get the selected F4 value from the first combobox. But the issue that i'm facing is, i'm unable to pass that value to the other combobox. Can some one help me with this?list.png

list.png (19.9 kB)
10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

3 Answers

Best Answer
avatar image
Former Member Mar 23 at 10:23 AM
0

Hi,

You have to bind separate models are each Table row.

this.getView().byId("idTable").getItems()[0].setModel(model, "comboBox2");

Regards,

Gururaj

Share
10 |10000 characters needed characters left characters exceeded
Simon Perstorfer Dec 08, 2017 at 10:55 AM
0

Hi Rama,

is your table based on a JSON Model?
If yes, every table row is bound to a entry in the model. You can save the selected key of the combobox to the entry in the model and access this saved key.

If not, you can create a event listener on changing combobox value and save the selected key to a seperate json model (f. e. create several entries in your json model representing each table row).

Regards
Simon

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

Hi Simon,

I'm not using JSON model. I'm trying to fetch data from Odata Model.

0
Akhilesh Upadhyay Dec 08, 2017 at 01:06 PM
0

you need to right something like below,

onChange: function(oEvent){
var selectedValue = //get selected value oEvent or model if model is twoway binding mode

var oFilter = new sap.ui.model.Filter("fieldname", "EQ", selectedValue);
secondCB.bindAggregation("items", {
  path: "/data path",
  filters: [oFilter],
  template: item_template
});

}
Share
10 |10000 characters needed characters left characters exceeded