Skip to Content
0
Former Member
Oct 31, 2016 at 09:06 AM

Combo box select SAP UI5

1543 Views Last edit May 27, 2020 at 08:26 AM 4 rev

Hi!

I have some problems with Combo Box. How can I avoid repeats? I have rows where "Layout" = * and I have in Combo box many *. Another question about getting row with this Layout.

Link to scrin

https://i.imgsafe.org/7114ae3880.png

My filter doesn't work. Maybe could you tell me where is my mistake?

    },
        onChange: function(oEvent) {
            var oTable = this.getView().byId("idStats");
            // getting the value of Combobox
            oTable.setShowOverlay(true);
        },
        onReset: function(oEvent) {
            // resetting the value of Combobox and initial state of the table
            var oTable = this.getView().byId("idStats");
            var oBinding = oTable.getBinding("items");
            oBinding.filter([]);
            oTable.setShowOverlay(false);
            this.byId("oComboBox").setSelectedItem(null);
        },
        onSearch: function(oEvent) {
            var oTable = this.getView().byId("idStats");
            var comboBoxValue = this.byId("oComboBox").getValue(),
                oBinding = oTable.getBinding("items"),
                oFilter;
            if (comboBoxValue || comboBoxValue === "") {
                oTable.setShowOverlay(false);
                oFilter = new Filter("Layout", "EQ", comboBoxValue);
                oBinding.filter([oFilter]);
            }
        },

Thank you in advance!

Regards,

Khristina