0

My fiori application has multiple tables, each with its' own search bar, in separate nested views. Is it possible to filter all tables using the same search bar? The code below works for filtering the table for the view I am on, but does not work on the other tables:

var oView = this.getView();
var sValue = oView.byId("searchField").getValue();
var oFilter = new Filter("Id", FilterOperator.Contains, sValue);

oView.byId("idTable1").getBinding("rows").filter(oFilter, FilterType.Application);
oView.byId("__xmlview2--idTable2").getBinding("rows").filter(oFilter, FilterType.Application);
oView.byId("__xmlview3--idTable3").getBinding("rows").filter(oFilter, FilterType.Application);
Ui5 Dev
  • 23
  • 3
  • What means "in separate nested views"? Are the tables not visible? Store the search value in a local model and apply it to the other tables/views when the other tables/views are unhidden. – alexP May 06 '22 at 09:16
  • 1
    Do those nested views have their own controllers? Or does only the parent view control the child views? – Boghyon Hoffmann May 08 '22 at 22:03
  • This is a bit too broad to answer as the question is lacking in details. There are multiple approaches depending on how the views are created and layered. You could do it with [bookmarkable search via Routing](https://sdk.openui5.org/topic/e85da535ea19430a90c381f3c2bd748e), you could do it with [EventBus](https://stackoverflow.com/q/37187748/5846045), ... – Boghyon Hoffmann May 18 '22 at 23:08

0 Answers0