Skip to Content
Feb 03, 2014 at 09:28 AM

Cannot read property 'document' of null datajs.js



I'm receiving an error and i'm trying to find its cause.

In this scenario i'm creating a JS view and inside the createContent function i'm creating some ui controls and an OData model.

my suspicion is that when i use the setModel, the call the the OData service is triggered before the control get a chance to render, but thats just a suspicion.

i've attached the error and the stack trace.

Help would be very appreciated.

Many Thanks,


  1. Uncaught TypeError: Cannot read property 'document' of null datajs.js:859

TypeError: Cannot read property 'document' of null at

Object.domById ( at sap.ui.core.Element.getDomRef (

at sap.ui.commons.ComboBox.invalidate (…153~/sap/ui/commons/library-preload.json/sap/ui/commons/ComboBox.js:57:219)

at sap.ui.core.Control.invalidate (

at sap.ui.base.ManagedObject.destroyAggregation (

at sap.ui.commons.ListBox.destroyItems (…1153~/sap/ui/commons/library-preload.json/sap/ui/commons/ListBox.js:50:209)

at sap.ui.commons.ComboBox.destroyItems (…153~/sap/ui/commons/library-preload.json/sap/ui/commons/ComboBox.js:45:117)

at sap.ui.commons.DropdownBox.destroyItems (…~/sap/ui/commons/library-preload.json/sap/ui/commons/DropdownBox.js:16:353)

at sap.ui.base.ManagedObject.updateAggregation (

at sap.ui.commons.ComboBox.updateItems (…1153~/sap/ui/commons/library-preload.json/sap/ui/commons/ComboBox.js:46:86)