cancel
Showing results for 
Search instead for 
Did you mean: 

How can I use Icon Tab bar filter and segmented button together?

Former Member
0 Kudos

Hi everyone,

I am trying to use Icon Tab Bar Filter and Segmented Button together. For example, Icon Tab Bar Filter is filtering data on base of Currency Code field, and segmented button is filtering data on base of Location ID. If i want to see the products with Location ID 0000000020 and with Currency USD, I need to select USD tab from Icon Tab Bar and 00020 from Segmented button.

But both filters are not working together. If I select Currency Code and then select Location ID. Filter is only implemented on Location ID.

Example of application is below.

I might need to use an array of filters to implement multiple filters together, but that is not working at this moment.

Can anyone help me to solve this?

Thanks in advance!

Accepted Solutions (0)

Answers (1)

Answers (1)

Sharathmg
Active Contributor
0 Kudos

You can add multiple filters Ex: currency and local id.

   binding.filter( [ new sap.ui.model.Filter([
      new sap.ui.model.Filter("currency", sap.ui.model.FilterOperator.Contains, query ),
      new sap.ui.model.Filter("locationId", sap.ui.model.FilterOperator.Contains, query )
   ],false)


Regards,
Sharath
Former Member
0 Kudos

Hi Sharath,

Thank you very much! It is working this way.

Former Member
0 Kudos

But it is not getting the selected key of segmented button when I am selecting an option from Icon Tab Bar. Here is the code.

	SetQuickFilter: function (oEvent) {
				var tkey = 	oEvent.getParameter("key"),
				obinding = this._oTable.getBinding("items");

				/* idSegmented is the ID for Segmented button */		
				var sbutton = this.byId("idSegmented"),
				skey = sbutton.getSelectedKey();
				obinding.filter([new sap.ui.model.Filter("CurrencyCode", sap.ui.model.FilterOperator.Contains, tkey), new sap.ui.model.Filter("ItemPosition", sap.ui.model.FilterOperator.Contains, skey)], false);
				}

Sharathmg
Active Contributor
0 Kudos

By default if one of the button is selected then you should get the key.

First, check is sbutton is retrieved right.

Then, check if by default button is set as seletec.

If above two options are true, you should get the selected key.

Regards,

Sharath