Skip to Content

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

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)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

3 Answers

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

    Hi,

    You have to bind separate models are each Table row.

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

    Regards,

    Gururaj

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 08, 2017 at 10:55 AM

    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

    Add comment
    10|10000 characters needed characters exceeded

  • Dec 08, 2017 at 01:06 PM

    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
    });
    
    }
    Add comment
    10|10000 characters needed characters exceeded