Skip to Content
0

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

Dec 27, 2016 at 07:27 AM

236

avatar image

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"

10 |10000 characters needed characters left characters exceeded
* Please Login or Register to Answer, Follow or Comment.

2 Answers

Deepak Anumula Dec 27, 2016 at 09:40 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded
Deepak Anumula Dec 27, 2016 at 09:40 AM
0

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.

Share
10 |10000 characters needed characters left characters exceeded