Skip to Content

UI5 List update - inconsistent behaviour when browsre console on/off

Hi all,

I've got an issue where I'm trying to update the list on the left hand side of my Master-Detail Application when a new Master Item is created;

I've put the following into the callback from the creation mechanism

sap.ui.getCore().byId("master").getModel().refresh(true);
				  
var myView = sap.ui.getCore().byId("master");
var myList = myView.byId("idResponsiveRepairsSet");
var binding = myList.getBinding("items");
    binding.refresh(true);	

And I've added a "Request Completed" on the Master-List's model:

	      oModel.attachRequestCompleted(function(){ 
	    	  console.log("oModel from Master Attach request completed")
	      });

Now the interesting thing is, if I've got the console open, I see the attachRequestCompleted log message "oModel from Master Attach request completed", and in the browser, the Master-List gets the new Master-List Item.

If I've not got the console open, the List on the Left Hand Side doesn't get updated...

It feels like the console is making something happen to the model that I need to put in to my oModel.attachRequestCompleted function; I tried a model refresh, but from what I could tell, that just caused an infinite loop - so now I'm not sure whether

model.refresh

>just updates the frontend elements (lists, tables, dropdowns etc) with recently read data,

or

>calls the backend for new data...

Any help really appreciated. I've looked at the documentation and followed the instructions as best I can, but not sure why there's inconsistent behaviour between console-on and console-off!? My best guess is that there's some kind of cache issue; i.e. when the console is on, browser wants to monitor network traffic, so actually makes the call, when console is off, browser assumes it can make use of the most recent back-end call?

Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

0 Answers