Represents a popup containing an image and a footer.
The purpose of the control is to display an image in its original size as long as this is possible. On smaller screens images are scaled down to fit.
Notes:
imageContent
aggregation of the control as well as the source of the image and the title of the image is mandatory. If the image source is not set, the control will not open.Each LightBox holds a LightBoxItem which keeps the properties of the image:
The most common use case is to click on an image thumbnail to view it in bigger size. When the image that should be displayed in the control cannot be loaded, an error is displayed in the popup.
On a mobile device, flipping the device to landscape will flip the lightbox and the image will be adjusted to fit the new dimensions.
Check out the API Reference.
Constructor for a new LightBox.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers. See sap.ui.base.ManagedObject#constructor for a general description of the syntax of the settings object.
new sap.m.LightBox(sId?, mSettings?)
Param | Type | Default Value | Description |
---|---|---|---|
sId? | string | ID for the new control, generated automatically if no ID is given |
|
mSettings? | object | Initial settings for the new control |
Default Aggregation: imageContent
Name | Cardinality | Type | Description |
---|---|---|---|
_busy | 0..1 | sap.m.BusyIndicator |
BusyIndicator for loading state. |
_closeButton | 0..1 | sap.m.Button |
The close button aggregation inside the LightBox control. This button has to have text in it. |
_invisiblePopupText | 0..1 | sap.ui.core.InvisibleText |
Hidden text used for accessibility of the popup. |
_verticalLayout | 0..1 | sap.ui.layout.VerticalLayout |
A layout control used to display the error texts when the image could not be loaded. |
imageContent (default) | 0..n | sap.m.LightBoxItem |
Aggregation which holds data about the image and its description. Although multiple LightBoxItems may be added to this aggregation only the first one in the list will be taken into account. |
Method | Description |
---|---|
addImageContent |
Adds some imageContent to the aggregation imageContent. |
bindImageContent |
Binds aggregation imageContent to model data. See ManagedObject.bindAggregation for a detailed description of the possible properties of |
close |
Closes the LightBox. |
destroyImageContent |
Destroys all the imageContent in the aggregation imageContent. |
exit |
Detaches all handlers and destroys the instance. |
sap.m.LightBox.extend |
Creates a new subclass of class sap.m.LightBox with name
|
getImageContent |
Gets content of aggregation imageContent. Aggregation which holds data about the image and its description. Although multiple LightBoxItems may be added to this aggregation only the first one in the list will be taken into account. |
sap.m.LightBox.getMetadata |
Returns a metadata object for class sap.m.LightBox. |
indexOfImageContent |
Checks for the provided |
init |
Sets up the initial values of the control. |
insertImageContent |
Inserts a imageContent into the aggregation imageContent. |
invalidate |
Invalidates the LightBox. |
isOpen |
Returns if the LightBox is open. |
onAfterRendering |
Overwrites the onAfterRendering. |
onBeforeRendering |
Overwrites the onBeforeRendering. |
open |
Opens the LightBox. |
removeAllImageContent |
Removes all the controls from the aggregation imageContent. Additionally, it unregisters them from the hosting UIArea. |
removeImageContent |
Removes a imageContent from the aggregation imageContent. |
unbindImageContent |
Unbinds aggregation imageContent from model data. |
Adds some imageContent to the aggregation imageContent.
Param | Type | DefaultValue | Description |
---|---|---|---|
oImageContent | sap.m.LightBoxItem |
The imageContent to add; if empty, nothing is inserted |
Binds aggregation imageContent to model data.
See ManagedObject.bindAggregation for a detailed description of the possible properties of oBindingInfo
.
Param | Type | DefaultValue | Description |
---|---|---|---|
oBindingInfo | sap.ui.base.ManagedObject.AggregationBindingInfo |
The binding information |
Creates a new subclass of class sap.m.LightBox 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.Control.extend.
Param | Type | DefaultValue | Description |
---|---|---|---|
sClassName | string |
Name of the class being created |
|
oClassInfo | object |
Object literal with information about the class |
|
FNMetaImpl | function |
Constructor function for the metadata object; if not given, it defaults to the metadata implementation used by this class |
Gets content of aggregation imageContent.
Aggregation which holds data about the image and its description. Although multiple LightBoxItems may be added to this aggregation only the first one in the list will be taken into account.
Checks for the provided sap.m.LightBoxItem
in the aggregation imageContent. and returns its index if found or -1 otherwise.
Param | Type | DefaultValue | Description |
---|---|---|---|
oImageContent | sap.m.LightBoxItem |
The imageContent whose index is looked for |
Inserts a imageContent into the aggregation imageContent.
Param | Type | DefaultValue | Description |
---|---|---|---|
oImageContent | sap.m.LightBoxItem |
The imageContent to insert; if empty, nothing is inserted |
|
iIndex | int |
The |
Invalidates the LightBox.
Param | Type | DefaultValue | Description |
---|---|---|---|
oOrigin | sap.ui.base.ManagedObject |
Origin of the invalidation. |
Removes all the controls from the aggregation imageContent.
Additionally, it unregisters them from the hosting UIArea.
Removes a imageContent from the aggregation imageContent.
Param | Type | DefaultValue | Description |
---|---|---|---|
vImageContent | int string sap.m.LightBoxItem |
The imageContent to remove or its index or id |