Class sap.ui.core.mvc.JSViewModule: sap/ui/core/mvc/JSView

extends View

A View defined/constructed by JavaScript code.
Constructor Summary
new sap.ui.core.mvc.JSView(sId?, mSettings?)Constructor for a new mvc/JSView.
Field Summary
sap.ui.core.mvc.JSView.asyncSupportFlag for feature detection of asynchronous loading/rendering
Events borrowed from class sap.ui.core.Control
Method Summary
sap.ui.core.mvc.JSView.create(mOptions)Creates an instance of the view with the given name (and id).
sap.ui.core.mvc.JSView.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ui.core.mvc.JSView with name sClassName and enriches it with the information contained in oClassInfo.
sap.ui.core.mvc.JSView.getMetadata()Returns a metadata object for class sap.ui.core.mvc.JSView.
createContent()A method to be implemented by JSViews, returning the View UI.
getAutoPrefixId()A method to be implemented by JSViews, returning the flag whether to prefix the IDs of controls automatically or not if the controls are created inside the sap.ui.core.mvc.JSView#createContent function.
Methods borrowed from class sap.ui.base.Object
Constructor Detail
new sap.ui.core.mvc.JSView(sId?, mSettings?)
Constructor for a new mvc/JSView.
Parameters:
stringsId?id for the new control, generated automatically if no id is given
objectmSettings?initial settings for the new control
Field Detail
sap.ui.core.mvc.JSView.asyncSupport
Flag for feature detection of asynchronous loading/rendering
Since:
1.30
Method Detail
sap.ui.core.mvc.JSView.create(mOptions): Promise
Creates an instance of the view with the given name (and id).
Parameters:
mapmOptionsA map containing the view configuration options.
stringmOptions.id?Specifies an ID for the View instance. If no ID is given, an ID will be generated.
stringmOptions.viewName?Name of the view. The view must be defined using sap.ui.core.mvc.JSView.extend.
sap.ui.core.mvc.ControllermOptions.controller?Controller instance to be used for this view. The given controller instance overrides the controller defined in the view definition. Sharing a controller instance between multiple views is not supported.
Returns:
PromiseA Promise that resolves with the view instance
Since:
1.56.0
sap.ui.core.mvc.JSView.extend(sClassName, oClassInfo?, FNMetaImpl?): function

Creates a new subclass of class sap.ui.core.mvc.JSView 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.mvc.View.extend.

Parameters:
stringsClassNameName of the class being created
objectoClassInfo?Object literal with information about the class
functionFNMetaImpl?Constructor function for the metadata object; if not given, it defaults to sap.ui.core.ElementMetadata
Returns:
functionCreated class / constructor function
sap.ui.core.mvc.JSView.getMetadata(): sap.ui.base.Metadata
Returns a metadata object for class sap.ui.core.mvc.JSView.
Returns:
sap.ui.base.MetadataMetadata object describing this class
createContent(): sap.ui.core.Control
A method to be implemented by JSViews, returning the View UI. While for declarative View types like XMLView or JSONView the user interface definition is declared in a separate file, JSViews programmatically construct the UI. This happens in the createContent method which every JSView needs to implement. The View implementation can construct the complete UI in this method - or only return the root control and create the rest of the UI lazily later on.
Returns:
sap.ui.core.Controla control or (typically) tree of controls representing the View user interface
getAutoPrefixId(): boolean

A method to be implemented by JSViews, returning the flag whether to prefix the IDs of controls automatically or not if the controls are created inside the sap.ui.core.mvc.JSView#createContent function. By default this feature is not activated.

You can overwrite this function and return true to activate the automatic prefixing.

Returns:
booleantrue, if the controls IDs should be prefixed automatically
Since:
1.15.1