Accessing Neptune Designer Objects in the Browser Console when developing with Neptune Planet 8 Version 6+

One of the common Neptune Development practices is to load an app directly into the browser and then check the values and properties of SAP UI5 objects directly in the browser console.  In the recent releases of the Neptune Planet 8 Platform the way that the application code is loaded has changed and you can no longer directly access the UI5 objects.


The screenshot below shows accessing the Admin App Settings Tab Bar in a version prior to version 6 of the Planet 8 Platform.


Accessing UI5 objects prior to version 6


The object is shown and it's properties can be accessed.  This is very useful when debugging and developing applications.


Accessing UI5 Object Properties


Doing the same in the latest Planet 8 version 6 releases returns the DOM element, not the UI5 Object.


Planet 8 Version 6+ shows the DOM Element


The UI5 Framework keeps track of all the objects, and the UI5 Framework is in the global scope so we can access UI5 Objects by their id.


Using the id to get the object


sap.ui.getCore().byId("tabBarSettingsDefaults").getText();
"Settings"


If you want to create a shortcut to save on typing create a variable that accesses sap.ui.getCore().byId.



In this case I've made a shortcut variable "z" so that I can call z("tabBarSettingsDefaults") to access the tabBarSettingsDefaults object.


Happy Coding!


1 person likes this
Login or Signup to post a comment

Site Data and Privacy Policy