cancel
Showing results for 
Search instead for 
Did you mean: 

controllerName attribute, data-sap-ui-theme in bootsrapping, slashes in AMD

prasad2k1
Explorer
0 Kudos

Hi Everyone,

I have recently started learning SAPUI5 and i have few questions as of now :-

1)when we are bootstrapping in UI5 we declare libraries using attribute data-sap-u-libs and we also use some more attributes like data-sap-ui-resourceroots, data-sap-ui-theme etc . how do we get to know what are all the possible attributes we can use ?

Could you please help me get to know what is technology sap adopted for this syntax(particularly for above mentioned attributes (with - notation) or just we have to mug up to use that syntax) ?

Example:-

<script id="sap-ui-bootstrap" src="https://sapui5.hana.ondemand.com/resources/sap-ui-core.js" data-sap-ui-libs="sap.m" data-sap-ui-theme="sap_bluecrystal" data-sap-ui-preload="async" data-sap-ui-compatVersion="edge" data-sap-ui-resourceroots='{ "ui5.myapp":"./" }' > </script>

2) when declaring xmlviews or else any other view we use attribute controllerName , where did it come from ? i have searched sap.ui.core.mvc.view (sap.ui.core.mvc.xmlview) and other libraries , but all they have is getcontrollername method , but i could not find controllername attribute anywhere .Could you also please help me with displayblock attribute as well.

<mvc:View
xmlns="sap.m"
xmlns:mvc="sap.ui.core.mvc"
controllerName = "ui5.MyApp.controller.App">
	<Carousel>
		<pages>
			<Image src="http://www.planwallpaper.com/static/images/images_1_05GM1zY.jpg" />
			<Image src="http://www.planwallpaper.com/static/images/images_1_05GM1zY.jpg" />
		</pages>
	</Carousel>
	
</mvc:View>

Could you please help with the documentation of these attributes

3)when defining controller using asynchronous module definition syntax we declare importing parameters as sap/ui/core/mvc/controller - for example

sap.ui.define([
"sap/ui/core/mvc/Controller",
"sap/m/MessageToast"
], function (Controller, MessageToast) {
"use strict";
return Controller.extend("ui5.myapp.controller.App", {
onShowHello : function () {
MessageToast.show("Hello ui5");
}
});
});

my question here is why are we using / symbols here in sap/ui/core/mvc/controller . when we instantiate a view in index.html page we instantiate it with sap.ui.xmlview (we are using dots here) .

Do we have to mug up all these things ? or could we find documentation anywhere? i have gone through https://sapui5.hana.ondemand.com but still having issues understanding concepts

Accepted Solutions (0)

Answers (1)

Answers (1)

junwu
Active Contributor
0 Kudos

no need to waste time on those you just mentioned. just remember them.

prasad2k1
Explorer
0 Kudos

Thanks for your answer Jun Wu. That's what i thought , we should just remember them .