Skip to Content
Nov 21 at 01:50 PM

SAP UI5 Master Detail - Bindelement does not work for the 2nd call

163 Views Last edit Nov 22 at 03:22 AM 4 rev

Hi there,

I have a list page to show all the employees and when I click the first data, I can successfully get the odata with the right data, e.g employeeSet('001')

But when I pressed back to the list and select another employee, e.g employeeSet('002'), it's still referring to the first data, when I debugged, the ID already being called as '002'.

But the textbox still showing the 1st data (001), what should I do?

When I refresh the page manually, the 2nd data is appearing.

Here's my detail view and the controller

<mvc:View xmlns:core="sap.ui.core" xmlns:mvc="sap.ui.core.mvc" xmlns="sap.m" xmlns:html=""
			<Page title="page">
					<VBox width="100%" direction="Column" id="__vbox0">
							<Text text="{Firstname}" id="__text0"/>
							<Text text="{Lastname}" id="__text1"/>
		onInit: function() {
			var oRouter = sap.ui.core.UIComponent.getRouterFor(this);
			oRouter.getRoute("employee").attachMatched(this._onRouteFound, this);

	// Custom Method to bind the elements using the Event Arguments
		_onRouteFound: function(oEvt) {
			var oArgument = oEvt.getParameter("arguments");
			var oView = this.getView();
				path: "/employeesSet('" + oArgument.Kodeemp + "')",
				events: {
					change: this._onBindingChange.bind(this),
					dataRequested: function(oEvent) {
					dataReceived: function(oEvent) {
		_onBindingChange: function(oEvent) {
			var oElementBinding = this.getView().getElementBinding();
			// No data for the binding
			if (oElementBinding && !oElementBinding.getBoundContext()) {