Creates and initializes a new UIComponent with the given sId
and settings.
The set of allowed entries in the mSettings
object depends on the concrete subclass and is described there. See sap.ui.core.Component for a general description of this argument.
Since: 1.9.2.
Method Summary
sap.ui.core.UIComponent.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.UIComponent with name sClassName
and enriches it with the information contained in oClassInfo
. byId(sId)Returns an element by its ID in the context of the component. createContent()The method to create the content (UI Control Tree) of the Component. createId(sId)Convert the given component local element ID to a globally unique ID by prefixing it with the component ID. getRouter()Returns the reference to the router instance which has been created by the UIComponent once the routes in the routing metadata has been defined. getTargets()Returns the reference to the Targets instance which has been created by the UIComponent once the targets in the routing metadata has been defined. getUIArea()Returns the reference to the UIArea of the container. init()Initializes the Component instance after creation. onAfterRendering()Function is called when the rendering of the ComponentContainer is completed. onBeforeRendering()Function is called when the rendering of the ComponentContainer is started. render(oRenderManager)Renders the the root control of the UIComponent. setContainer(oContainer)Sets the reference to the ComponentContainer - later required for the determination of the UIArea for the UIComponent. exit,
getComponentData,
getEventBus,
getInterface,
getManifest,
getManifestEntry,
getManifestObject,
getMetadata,
getService,
onConfigChange,
onWindowBeforeUnload,
onWindowError,
onWindowUnload,
runAsOwner addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
clone,
destroy,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
invalidate,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
toString,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty Constructor Detail
new sap.ui.core.UIComponent(sId?, mSettings?)
Base Class for UIComponent.
If you are extending an UIComponent make sure you read the .extend documentation since the metadata is special.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject for a general description of the syntax of the settings object.
The supported settings are:
In addition, all settings applicable to the base type sap.ui.core.Component can be used as well.
Parameters:
{string} | sId? | Optional ID for the new control; generated automatically if no non-empty ID is given Note: this can be omitted, no matter whether mSettings will be given or not! |
{object} | mSettings? | optional map/JSON-object with initial settings for the new component instance |
Method Detail
sap.ui.core.UIComponent.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ui.core.UIComponent with name
sClassName
and enriches it with the information contained in
oClassInfo
.
oClassInfo
might contain the same kind of information as described in sap.ui.core.Component.extend.
Parameters:
{string} | sClassName | Name of the class being created |
{object} | oClassInfo? | Object literal with information about the class |
{function} | FNMetaImpl? | Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata |
Returns:
{function} | Created class / constructor function |
Returns a metadata object for class sap.ui.core.UIComponent.
Returns:
Returns the reference to the router instance. The passed controller or view has to be created in the context of a UIComponent to return the router instance. Otherwise this function will return undefined. You may define the routerClass property in the config section of the routing to make the Component create your router extension. Example: routing: { config: { routerClass : myAppNamespace.MyRouterClass ... } ...
Parameters:
- Since:
- 1.16.1
Returns:
Returns an element by its ID in the context of the component.
Parameters:
{string} | sId | Component local ID of the element |
Returns:
createContent()
The method to create the content (UI Control Tree) of the Component. This method has to be overwritten in the implementation of the component if the root view is not declared in the component metadata.
createId(sId): string
Convert the given component local element ID to a globally unique ID by prefixing it with the component ID.
Parameters:
{string} | sId | Component local ID of the element |
Returns:
getAutoPrefixId(): boolean
A method to be implemented by UIComponents, returning the flag whether to prefix the IDs of controls automatically or not if the controls are created inside the
sap.ui.core.UIComponent#createContent function. By default this feature is not activated.
You can overwrite this function and return true
to activate the automatic prefixing. In addition the default behavior can be configured in the manifest by specifying the entry sap.ui5/autoPrefixId
.
- Since:
- 1.15.1
Returns:
{boolean} | true, if the Controls IDs should be prefixed automatically |
Returns the reference to the router instance which has been created by the UIComponent once the routes in the routing metadata has been defined.
- Since:
- 1.16.1
Returns:
Returns the reference to the Targets instance which has been created by the UIComponent once the targets in the routing metadata has been defined. If routes have been defined, it will be the Targets instance created and used by the router.
- Since:
- 1.28
Returns:
Returns the reference to the UIArea of the container.
Returns:
init()
Initializes the Component instance after creation.
Applications must not call this hook method directly, it is called by the framework while the constructor of a Component is executed.
Subclasses of Component should override this hook to implement any necessary initialization. When overriding this function make sure to invoke the init function of the UIComponent as well!
onAfterRendering()
Function is called when the rendering of the ComponentContainer is completed.
Applications must not call this hook method directly, it is called from ComponentContainer.
Subclasses of UIComponent override this hook to implement any necessary actions after the rendering.
onBeforeRendering()
Function is called when the rendering of the ComponentContainer is started.
Applications must not call this hook method directly, it is called from ComponentContainer.
Subclasses of UIComponent override this hook to implement any necessary actions before the rendering.
render(oRenderManager)
Renders the the root control of the UIComponent.
Parameters:
Sets the reference to the ComponentContainer - later required for the determination of the UIArea for the UIComponent.
Parameters:
Returns: