on 02-28-2019 7:12 PM
I have used a simple XML for a DynamicSideContent (and have even taken the sample XML file from the SAP UI5 Explored website) and deployed it to our SAP environment (sap.ui.version is 1.44.32).
I get the following error every time:
"Uncaught Error: failed to load 'sap/ui/layout/DynamicSideContent.js' from resources/sap/ui/layout/DynamicSideContent.js: TypeError: Cannot read property 'ShowAboveS' of undefined"
I have tried explicitly setting the sideContentVisibility to AlwaysShow in the XML. I can see from the SAPUI5 Diagnostics dialog pop-up that sap.ui.layout v1.44.32 is loaded.
Any suggestions how I fix it?
I got it working. The missing SideContentVisibility enum is in the sap ui layout library.js, which was not being loaded. After reading the following link:
sapui5 failed to load resource library, I went to the index.html and in the <script> tag and changed
data-sap-ui-libs="sap.m"
to
data-sap-ui-libs="sap.m, sap.ui.layout"
and then I could see the sap.ui.layout library with all the supporting classes get loaded, and the DynamicSideContent displayed correctly!
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
This issue arises when js/jquery is not able to refer to the element. It is because at the time of rendering the page(view), object is null or undefined - which means that there is no instance of a class in the variable. If you are getting data for object from an async call(api's), these kind of problems will arise. So you should always check the object whether it is null or undefined then if it is not, you can access its properties.
The standard way to catch null and undefined simultaneously is this:
if (variable == null)
{
// your code here.
}
Because null == undefined is true, the above code will catch both null and undefined.
Also you can write equivalent to more explicit but less concise:
if (variable === undefined variable === null)
{
// your code here.
}
This should work for any variable that is either undeclared or declared and explicitly set to null or undefined.
In most cases this error is related to getElementById(). So getting a value from an input could look like this:
var value = document.getElementById("frm_new_user_request").value
Also you can use some JavaScript framework, e.g. jQuery, which simplifies operations with DOM (Document Object Model) and also hides differences between various browsers from you.
Getting a value from an input using jQuery would look like this:
input with ID "element": var value = $("#element).value
input with class "element": var value = $(".element).value
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.