cancel
Showing results for 
Search instead for 
Did you mean: 

ODataTreeBinding: Filters have no effect

fabian_krger
Participant
0 Kudos

Hello,

I have a sap.ui.tableTreeTable and create a row binding.


var oTable = new sap.ui.table.TreeTable({

                columns: [

                          new sap.ui.table.Column(...),

                         ...

               ],

               rows: {

                     path: "/ScenarioCategories",

                     filters: [new sap.ui.model.Filter("ScenarioType", sap.ui.model.FilterOperator.EQ, "Fiori")],

                     parameters: {

                          expand: "Scenarios",

                          navigation: {"ScenarioCategories": "Scenarios"}

                     }

                }

});

oTable.setModel(new sap.ui.model.odata.ODataModel(sUrl);

However, the filters are getting ignored (are not part of the URL which is requested in background).

I've checked the SAPUI5 code in 1.28.7 and didn't find any code that would add it to the request.

There is nothing in .getRootContexts, nothing in ._getContextsForNodeId ($expand is added here for example) and nothing in ._loadSubNodes

I've also checked the .v2 version of ODataTreeBinding with same results.

Could you please fix this issue?

Only location where it is actually considered is in the .getDownloadUrl of .v2.ODataTreeBinding

Thanks,

Fabian

Accepted Solutions (1)

Accepted Solutions (1)

former_member182372
Active Contributor
0 Kudos

ODataTreeBinding.prototype.filter = function(aFilters){

  jQuery.sap.log.warning("Filtering is currently not possible in the ODataTreeBinding");

  return this;

};

....

ODataTreeBinding.prototype.getDownloadUrl = function(sFormat) {

  var aParams = [],

  sPath;

  if (sFormat) {

  aParams.push("$format=" + encodeURIComponent(sFormat));

  }

  // sort and filter not supported yet

  /*if (this.sSortParams) {

  aParams.push(this.sSortParams);

  }

  if (this.sFilterParams) {

  aParams.push(this.sFilterParams);

  }*/

fabian_krger
Participant
0 Kudos

oh thanks, didn't see the warning because I added the filters directly in the binding and not by calling .filter()...

Hopefully this feature will be added soon...

Answers (0)