cancel
Showing results for 
Search instead for 
Did you mean: 

how to filter combobox in sapui5 based on another combox value.. plz send me any solution..

Former Member
0 Kudos

i already coded for combobox in selectionChange(event)

onCountrybind: function(oEvent)

{ var regCombo = this.getView().byId("idCRegion"); var country = sap.ui.getCore().byId("idCCombobox"); var countryFilter = country.getSelectedItem(); regCombo.setEditable(true); var Filter = new sap.ui.model.Filter( "COUNTRY_KEY", "EQ", countryFilter); var regCombo = this.getView().byId("idCRegion"); var rModel = new sap.ui.model.odata.ODataModel("mymodel"); rModel.setSizeLimit(999999); var oRItemTemplate = new sap.ui.core.ListItem({key:"{REGION_KEY}",text:"{REGION_KEY}", additionalText:"{REGION_TEXT}" }); regCombo.setModel(rModel); regCombo.bindAggregation("items",{path: '/REGION',template: oRItemTemplate,filters:Filter}); }

<ComboBox id="idCCombobox" showSecondaryValues="true" selectionChange="onCountrybind"/>

<ComboBox id="idCRegion" showSecondaryValues="true"/>

i am getting error like---"Cannot read property 'getSelectedItem' of undefined"

Accepted Solutions (0)

Answers (2)

Answers (2)

former_member203031
Contributor
0 Kudos

Hello Manohar,

You can use some local json model as per the selection of combobox-1 you need to filter the values,Values are to maintain in the local JSON Model and the values need to bind to the combobox-2 .

Thanks,

Deepak.

former_member203031
Contributor
0 Kudos

Hello Manohar,

You can use some local json model as per the selection of combobox-1 you need to filter the values,Values are to maintain in the local JSON Model and the values need to bind to the combobox-2 .

Thanks,

Deepak.