Show TOC

Defining Control PropertiesLocate this document in the navigation structure

Control properties are defined as follows:

properties: {
   "title" : "string",                         // a simple string property, default value is {{{undefined}}}
   "buttonText" : {defaultValue: "Search"},    // when no type is given, the type is {{{string}}}
   "showLogoutButton" : {type : "boolean", defaultValue : true},   // a boolean property where a default value is given
   "width" : {type : "sap.ui.core.CSSSize", defaultValue : "50px"} // a CSS size property where a default value is given

After the property is defined, the control automatically has the setShowLogoutButton and getShowLogoutButton methods for storing data. It is possible to assign custom definitions to these methods by overriding them and calling the generic property methods setProperty and getProperty:

MyControl.prototype.setShowLogoutButton = function(show) {
	// …here anything in addition to the default handling can be done…
	// then do the default handling:
	this.setProperty("showLogoutButton", show); // this validates and stores the new value
	return this; // return "this" to allow method chaining