on 02-03-2014 9:28 AM
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
TypeError: Cannot read property 'document' of null at
Object.domById (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core....) at sap.ui.core.Element.getDomRef (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core....)
at sap.ui.commons.ComboBox.invalidate (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…153~/sap/ui/commons/libr...)
at sap.ui.core.Control.invalidate (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core....)
at sap.ui.base.ManagedObject.destroyAggregation (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core....)
at sap.ui.commons.ListBox.destroyItems (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…1153~/sap/ui/commons/lib...)
at sap.ui.commons.ComboBox.destroyItems (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…153~/sap/ui/commons/libr...)
at sap.ui.commons.DropdownBox.destroyItems (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…~/sap/ui/commons/library...)
at sap.ui.base.ManagedObject.updateAggregation (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~201312101153~/sap-ui-core....)
at sap.ui.commons.ComboBox.updateItems (https://cloudnwcportal-danoneb2bdev.hana.ondemand.com/ui5-dist/resources/~2…1153~/sap/ui/commons/lib...)
any idea?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Can you share the snippet ?
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
its a bit complex because the code is splitted around many files (and i dont have access to all of it)
but basiscally its something like this:
var cell12 = new sap.ui.commons.layout.MatrixLayoutCell({
colSpan : 1
});
var lblChannel = new sap.ui.commons.Label("lblChannel");
lblChannel.setText(sharedData.getLocalizedText("cust_search.distchan.lbl"));
lblChannel.setDesign(sap.ui.commons.LabelDesign.Bold);
cell11.addContent(lblChannel);
var ddbChannel = new sap.ui.commons.DropdownBox("ddbChannel");
ddbChannel.setModel(sharedData.getCustomerSearchModel());
var oItemTemplate = new sap.ui.core.ListItem();
oItemTemplate.bindProperty("key", "Distrchn");
oItemTemplate.bindProperty("text", "DistrchnT", function(fValue) {
return this.getProperty("key") + " " + fValue;
});
ddbChannel.bindItems("/DistChannelCollection", oItemTemplate, null, [ new sap.ui.model.Filter("Salesorg", sap.ui.model.FilterOperator.EQ, gadgets.sappopup
.getParameters(context)[0].salesOrganization.getParameter("Salesorg")) ]);
sharedData.getCustomerSearchModel() does:
var x = new sap.ui.model.odata.ODataModel(sServiceUrl, dataTypeJson);
x.setCountSupported(false);
return x
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.