Quantcast
Channel: SCN : All Content - SAPUI5 Developer Center
Viewing all articles
Browse latest Browse all 6178

Constructor functions in OpenUI5

$
0
0

Heads up ,I am new to Openui5 and JS .

 

What is normal way to create new js classes (Constructor functions) in OpenUI5?

 

I have learnt one way to extend the existing class is to use extend function in each class. Is this function propagated by augmenting extend function to prototype of some base sap.ui class?

 

I am bit confused about the inheritance process because when we use extend function we are passing a new class name but we are nowhere defining the Constructor function for new Object type.

 

e.g.

 

I need to extend from a TextField I would write

 

sap.ui.commons.TextField.extend("myapplication.MyControl",{properties and function of mycontrol});

 

and when I use it

 

var ctrl = new myapplication.MyControl("ctrlId",{some properties and function});

 

but I have nowhere defined the MyControl function.


Viewing all articles
Browse latest Browse all 6178

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>