Skip to Content
0

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

May 04, 2017 at 09:49 AM

70

avatar image
Former Member

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!

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

1 Answer

Sharath M G May 04, 2017 at 01:03 PM
0

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
Show 3 Share
10 |10000 characters needed characters left characters exceeded
Former Member

Hi Sharath,

Thank you very much! It is working this way.

0
Former Member

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);
				}

0

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

0