oTableClients.attachRowSelectionChange( function(oEvent){
// first, we fetch the binding context of the selected row
var selectedRowContext = oEvent.getParameter("rowContext");
// get the ID of the customer via rowContext. The model-object represents the data of the first table
var selectedClientId = oModel,getProperty("id", selectedRowContext);
// get binding of second table
var ordersBinding = oTableOrders.getBinding();
//create new filter to show the relevant data for the selected customer
var oFilter = new sap.ui.model.Filter("clientId", sap.ui.model.FilterOperation.EQ, selectedClientId);
// apply filter to binding
ordersBinding.filter([oFilter]);
});
onMasterItemSelect : function(event) {
// get the binding context of the currently selected master item, e.g. /master/0
var masterBindingContext = event.getParameter("listItem").getBindingContext();
// bind detail table to the selected master item using bindElement
this.byId("details").bindElement(masterBindingContext.getPath());
}