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

Custom controller init & arguments

$
0
0

Hi there,

 

i would like to know if it is possible to pass arguments to a custom control constructor that are not properties/events/aggregation/etc.

I already read a lot of documentation as UI Controller without finding a way to do this.

 

I tried (and failed) some ways  :

 

-Instantiation

var oObject = new custom.TreeNode(sId,iNumber,mSettings);

or

var oObject = new custom.TreeNode(sId,{text:"test, width:100, ... , anArgumentThatIsNOTAproperty:12});

-Controller

custom.TreeNode.prototype.init = function(aThing){
console.log(arguments); //empty array
console.log(mSettings);//error not defined
console.log(aThing);////undefined
console.log(anArgumentThatIsNOTAproperty);//error not defined
console.log(this.anArgumentThatIsNOTAproperty);//undefined
if(sap.ui.commons.TreeNode.prototype.init){     sap.ui.commons.TreeNode.prototype.init.apply(this,arguments);
}
};

 

Thanks for your help,

Regards,

Marc


Viewing all articles
Browse latest Browse all 6178

Trending Articles



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