Skip to Content
Oct 20, 2019 at 06:50 AM

Implementing all the filter to work togather



I need the functionality where the user enters the customer Id, EAN, Category into the multiInput and the filter should filter the tuples satisfying all the user entries togather and my filters are working individually currently. also I should remove or add further filtersgroups.

<fb:FilterGroupItem groupName="__$INTERNAL$" name="c" label="Customer ID" id='idCustomer' partOfCurrentVariant="true" visibleInFilterBar="true">


<MultiInputtype="Text"placeholder="Enter Customer id" showValueHelp="true" valueHelpRequest="onF4Help"></MultiInput>



<fb:FilterGroupItem groupName="__$INTERNAL$" name="e" label="EAN / UPC" id ="idEan" partOfCurrentVariant="true" visibleInFilterBar="true">


<MultiInputtype="Text"placeholder="Enter EAN / UPC" showValueHelp="true" valueHelpRequest="onF4Help"></MultiInput>



<fb:FilterGroupItem groupName="__$INTERNAL$" name="ef" label="Category" id = "idGroupName" partOfCurrentVariant="true" visibleInFilterBar="true">


<MultiInputtype="Text"placeholder="Enter Category" showValueHelp="true" valueHelpRequest="onF4Help"></MultiInput>



And corrosponding to its controller.js file i have written as...

Like for customers input checking...

if (customer != '') { var oFilter1 = new sap.ui.model.Filter( "customer", sap.ui.model.FilterOperator.Contains, customer); oTableSearchState.push(oFilter1); };... same for rest of 3's input boxes...


var oFilter3 = new sap.ui.model.Filter( "customer", sap.ui.model.FilterOperator.NE, customer ); if (oTableSearchState.length == 0) { oTableSearchState.push(oFilter3); };

var oFilter = new sap.ui.model.Filter({ filters: oTableSearchState, and: false });

I am also popping dialog box for selecting more then one input from multiInput that user is entering ...

fieldId: "",

cityPopup: null,

supplierPopup: null,

onF4Help: function(oEvent){

this.fieldId = oEvent.getSource().getId();

if(this.cityPopup === null){

this.cityPopup = new sap.ui.xmlfragment("sap.ui.demo.worklist.Fragment.CustomerInputDialog", this);

var oSorter = new sap.ui.model.Sorter('customer');


path: "REPGR>/repgr", sorter: oSorter, template: new sap.m.DisplayListItem({

label: "{REPGR>customer}", value: "{REPGR>Product_Ean}", info: "{REPGR>Product_Ean}"

}) });





Your help is awaited..