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

Cannot read property 'document' of null datajs.js

356 Views

Hi,

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,


Rafi


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




TypeError: Cannot read property 'document' of null at

Object.domById (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core.js:79:839) at sap.ui.core.Element.getDomRef (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core.js:126:131607)

at sap.ui.commons.ComboBox.invalidate (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…153~/sap/ui/commons/library-preload.json/sap/ui/commons/ComboBox.js:57:219)

at sap.ui.core.Control.invalidate (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core.js:126:140250)

at sap.ui.base.ManagedObject.destroyAggregation (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core.js:126:111761)

at sap.ui.commons.ListBox.destroyItems (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…1153~/sap/ui/commons/library-preload.json/sap/ui/commons/ListBox.js:50:209)

at sap.ui.commons.ComboBox.destroyItems (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…153~/sap/ui/commons/library-preload.json/sap/ui/commons/ComboBox.js:45:117)

at sap.ui.commons.DropdownBox.destroyItems (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…~/sap/ui/commons/library-preload.json/sap/ui/commons/DropdownBox.js:16:353)

at sap.ui.base.ManagedObject.updateAggregation (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core.js:126:122248)

at sap.ui.commons.ComboBox.updateItems (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…1153~/sap/ui/commons/library-preload.json/sap/ui/commons/ComboBox.js:46:86)