Enables users to add pictures into a form. Contains PictureItem controls that describe the media. It is designed to be used simultaneously with the PictureViewer control
Deprecated API:Since version 1.26. As per central UX requirements, this control is replaced by sap.m.UploadCollection. Please use the new control if you start developing an application instead of using this AddPicture control.
Event Summary
fileNotSupported(oControlEvent)Image upload failed, only supports image format files imageUploadFailed(oControlEvent)Indicates that the image upload failed, only used as a fallback when FileReader is not supported by the browser pictureAdded(oControlEvent)Indicates that the image upload failed, only used as a fallback when FileReader is not supported by the browser show(oControlEvent)Indicates that the user wishes to view the picture Method Summary
sap.ca.ui.AddPicture.extend(sClassName, oClassInfo?, FNMetaImpl?)Creates a new subclass of class sap.ca.ui.AddPicture with name sClassName
and enriches it with the information contained in oClassInfo
. addPicture(oPicture)Adds some picture oPicture
to the aggregation named pictures
. attachFileNotSupported(oData?, fnFunction, oListener?)Attach event handler fnFunction
to the 'fileNotSupported' event of this sap.ca.ui.AddPicture
. attachImageUploadFailed(oData?, fnFunction, oListener?)Attach event handler fnFunction
to the 'imageUploadFailed' event of this sap.ca.ui.AddPicture
. attachMaxPictureLimitReached(oData?, fnFunction, oListener?)Attach event handler fnFunction
to the 'maxPictureLimitReached' event of this sap.ca.ui.AddPicture
. attachPictureAdded(oData?, fnFunction, oListener?)Attach event handler fnFunction
to the 'pictureAdded' event of this sap.ca.ui.AddPicture
. attachShow(oData?, fnFunction, oListener?)Attach event handler fnFunction
to the 'show' event of this sap.ca.ui.AddPicture
. bindPictures(sPath, oTemplate, oSorter, aFilters)Binder for aggregation pictures
. destroyPictures()Destroys all the pictures in the aggregation named pictures
. detachFileNotSupported(fnFunction, oListener)Detach event handler fnFunction
from the 'fileNotSupported' event of this sap.ca.ui.AddPicture
. detachImageUploadFailed(fnFunction, oListener)Detach event handler fnFunction
from the 'imageUploadFailed' event of this sap.ca.ui.AddPicture
. detachMaxPictureLimitReached(fnFunction, oListener)Detach event handler fnFunction
from the 'maxPictureLimitReached' event of this sap.ca.ui.AddPicture
. detachPictureAdded(fnFunction, oListener)Detach event handler fnFunction
from the 'pictureAdded' event of this sap.ca.ui.AddPicture
. detachShow(fnFunction, oListener)Detach event handler fnFunction
from the 'show' event of this sap.ca.ui.AddPicture
. fireShow(mArguments?)Fire event show to attached listeners. indexOfPicture(oPicture)Checks for the provided sap.ca.ui.PictureItem
in the aggregation named pictures
and returns its index if found or -1 otherwise. insertPicture(oPicture, iIndex)Inserts a picture into the aggregation named pictures
. removePicture(vPicture)Removes an picture from the aggregation named pictures
. setText(sValue)Set the text for the button setWidth(sWidth)Setter for property width
. addStyleClass,
allowTextSelection,
attachBrowserEvent,
attachValidateFieldGroup,
checkFieldGroupIds,
clone,
detachBrowserEvent,
detachValidateFieldGroup,
fireValidateFieldGroup,
getAccessibilityInfo,
getBusy,
getBusyIndicatorDelay,
getControlsByFieldGroupId,
getFieldGroupIds,
getIdForLabel,
getRenderer,
getVisible,
hasStyleClass,
invalidate,
isBusy,
onBeforeRendering,
placeAt,
removeStyleClass,
rerender,
setBusy,
setBusyIndicatorDelay,
setFieldGroupIds,
setVisible,
toggleStyleClass,
triggerValidateFieldGroup $,
addCustomData,
addDependent,
addEventDelegate,
applyFocusInfo,
bindElement,
data,
destroy,
destroyCustomData,
destroyDependents,
destroyLayoutData,
destroyTooltip,
enhanceAccessibilityState,
findElements,
fireEvent,
focus,
getCustomData,
getDependents,
getDomRef,
getElementBinding,
getFocusDomRef,
getFocusInfo,
getInterface,
getLayoutData,
getMetadata,
getTooltip,
getTooltip_AsString,
getTooltip_Text,
indexOfCustomData,
indexOfDependent,
insertCustomData,
insertDependent,
prop,
removeAllCustomData,
removeAllDependents,
removeCustomData,
removeDependent,
removeEventDelegate,
setLayoutData,
setTooltip,
toString,
unbindElement addAggregation,
addAssociation,
applySettings,
attachFormatError,
attachModelContextChange,
attachParseError,
attachValidationError,
attachValidationSuccess,
bindAggregation,
bindContext,
bindObject,
bindProperty,
destroyAggregation,
detachFormatError,
detachModelContextChange,
detachParseError,
detachValidationError,
detachValidationSuccess,
findAggregatedObjects,
fireFormatError,
fireModelContextChange,
fireParseError,
fireValidationError,
fireValidationSuccess,
getAggregation,
getAssociation,
getBinding,
getBindingContext,
getBindingInfo,
getBindingPath,
getEventingParent,
getId,
getModel,
getObjectBinding,
getOriginInfo,
getParent,
getProperty,
hasModel,
indexOfAggregation,
insertAggregation,
isBound,
isInvalidateSuppressed,
isTreeBinding,
propagateMessages,
removeAggregation,
removeAllAggregation,
removeAllAssociation,
removeAssociation,
setAggregation,
setAssociation,
setBindingContext,
setModel,
setProperty,
unbindAggregation,
unbindContext,
unbindObject,
unbindProperty,
validateAggregation,
validateProperty Constructor Detail
new sap.ca.ui.AddPicture(sId?, mSettings?)
Constructor for a new AddPicture.
Accepts an object literal mSettings
that defines initial property values, aggregated and associated objects as well as event handlers.
If the name of a setting is ambiguous (e.g. a property has the same name as an event), then the framework assumes property, aggregation, association, event in that order. To override this automatic resolution, one of the prefixes "aggregation:", "association:" or "event:" can be added to the name of the setting (such a prefixed name must be enclosed in single or double quotes).
The supported settings are:
- Properties
- Aggregations
- Associations
- Events
- show : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
- pictureAdded : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
- maxPictureLimitReached : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
- imageUploadFailed : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
- fileNotSupported : fnListenerFunction or [fnListenerFunction, oListenerObject] or [oData, fnListenerFunction, oListenerObject]
Parameters:
{string} | sId? | id for the new control, generated automatically if no id is given |
{object} | mSettings? | initial settings for the new control |
- Deprecated:
- Since version 1.26. As per central UX requirements, this control is replaced by sap.m.UploadCollection. Please use the new control if you start developing an application instead of using this AddPicture control.
Event Detail
fileNotSupported(oControlEvent)
Image upload failed, only supports image format files
Parameters:
{sap.ui.base.Event} | oControlEvent | |
{sap.ui.base.EventProvider} | oControlEvent.getSource | |
{object} | oControlEvent.getParameters | |
{any} | oControlEvent.getParameters.fileNames | An array containing the file names that are not supported |
imageUploadFailed(oControlEvent)
Indicates that the image upload failed, only used as a fallback when FileReader is not supported by the browser
Parameters:
maxPictureLimitReached(oControlEvent)
Indicates that the limit number of pictures has been reached
Parameters:
pictureAdded(oControlEvent)
Indicates that the image upload failed, only used as a fallback when FileReader is not supported by the browser
Parameters:
show(oControlEvent)
Indicates that the user wishes to view the picture
Parameters:
Method Detail
sap.ca.ui.AddPicture.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ca.ui.AddPicture with name
sClassName
and enriches it with the information contained in
oClassInfo
.
oClassInfo
might contain the same kind of informations as described in Element.extend.
Parameters:
{string} | sClassName | name of the class to be created |
{object} | oClassInfo? | object literal with informations about the class |
{function} | FNMetaImpl? | constructor function for the metadata object. If not given, it defaults to sap.ui.core.ElementMetadata. |
Returns:
{function} | the created class / constructor function |
Returns a metadata object for class sap.ca.ui.AddPicture.
Returns:
Adds some picture oPicture
to the aggregation named pictures
.
Parameters:
Returns:
Attach event handler
fnFunction
to the 'fileNotSupported' event of this
sap.ca.ui.AddPicture
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.AddPicture
.
itself. Image upload failed, only supports image format files
Parameters:
{object} | oData? | An application specific payload object, that will be passed to the event handler along with the event object when firing the event. |
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ca.ui.AddPicture . itself. |
Returns:
Attach event handler
fnFunction
to the 'imageUploadFailed' event of this
sap.ca.ui.AddPicture
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.AddPicture
.
itself. Indicates that the image upload failed, only used as a fallback when FileReader is not supported by the browser
Parameters:
{object} | oData? | An application specific payload object, that will be passed to the event handler along with the event object when firing the event. |
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ca.ui.AddPicture . itself. |
Returns:
Attach event handler
fnFunction
to the 'maxPictureLimitReached' event of this
sap.ca.ui.AddPicture
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.AddPicture
.
itself. Indicates that the limit number of pictures has been reached
Parameters:
{object} | oData? | An application specific payload object, that will be passed to the event handler along with the event object when firing the event. |
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ca.ui.AddPicture . itself. |
Returns:
Attach event handler
fnFunction
to the 'pictureAdded' event of this
sap.ca.ui.AddPicture
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.AddPicture
.
itself. Indicates that the image upload failed, only used as a fallback when FileReader is not supported by the browser
Parameters:
{object} | oData? | An application specific payload object, that will be passed to the event handler along with the event object when firing the event. |
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ca.ui.AddPicture . itself. |
Returns:
Attach event handler
fnFunction
to the 'show' event of this
sap.ca.ui.AddPicture
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.AddPicture
.
itself. Indicates that the user wishes to view the picture
Parameters:
{object} | oData? | An application specific payload object, that will be passed to the event handler along with the event object when firing the event. |
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener? | Context object to call the event handler with. Defaults to this sap.ca.ui.AddPicture . itself. |
Returns:
Binder for aggregation pictures
.
Parameters:
{string} | sPath | path to a list in the model |
{sap.ui.core.Element} | oTemplate | the control template for this aggregation |
{sap.ui.model.Sorter} | oSorter | the initial sort order (optional) |
{array} | aFilters | the predefined filters for this aggregation (optional) |
Returns:
Destroys all the pictures in the aggregation named pictures
.
Returns:
Detach event handler
fnFunction
from the 'fileNotSupported' event of this
sap.ca.ui.AddPicture
.
The passed function and listener object must match the ones used for event registration.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener | Context object on which the given function had to be called. |
Returns:
Detach event handler
fnFunction
from the 'imageUploadFailed' event of this
sap.ca.ui.AddPicture
.
The passed function and listener object must match the ones used for event registration.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener | Context object on which the given function had to be called. |
Returns:
Detach event handler
fnFunction
from the 'maxPictureLimitReached' event of this
sap.ca.ui.AddPicture
.
The passed function and listener object must match the ones used for event registration.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener | Context object on which the given function had to be called. |
Returns:
Detach event handler
fnFunction
from the 'pictureAdded' event of this
sap.ca.ui.AddPicture
.
The passed function and listener object must match the ones used for event registration.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener | Context object on which the given function had to be called. |
Returns:
Detach event handler
fnFunction
from the 'show' event of this
sap.ca.ui.AddPicture
.
The passed function and listener object must match the ones used for event registration.
Parameters:
{function} | fnFunction | The function to call, when the event occurs. |
{object} | oListener | Context object on which the given function had to be called. |
Returns:
Fire event fileNotSupported to attached listeners.
Expects following event parameters:
- 'fileNames' of type
any
An array containing the file names that are not supported
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
Fire event imageUploadFailed to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
Fire event maxPictureLimitReached to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
Fire event pictureAdded to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
Fire event show to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
getButtonPageType(): string
Getter for property
buttonPageType
. The page container type in which the button is embedded : Tab or Form
Default value is Tab
Returns:
{string} | the value of property buttonPageType |
getCompression(): string
Getter for property
compression
. Defines whether or not you want to maximize the compression. Possible values : "Low" (thumbnail size) or "High" (screen size)
Default value is low
Returns:
{string} | the value of property compression |
getEditable(): boolean
Getter for property
editable
. Defines whether the button should appear or not.
Default value is true
Returns:
{boolean} | the value of property editable |
getItemSize(): int
Getter for property
itemSize
. Defines thumbnail size (height / width) in Pixels
Default value is 64
Returns:
{int} | the value of property itemSize |
getMaxPictureNumber(): int
Getter for property
maxPictureNumber
. Defines the maximum number of pictures you can add. Default is set to 10
Default value is 10
Returns:
{int} | the value of property maxPictureNumber |
Getter for property
pictureAlign
. The text of the button.
Default value is Left
Returns:
Getter for aggregation pictures
.
The list of pictures
Returns:
getText(): string
Getter for property
text
. The text of the button.
Default value is empty/undefined
Returns:
{string} | the value of property text |
getUploadUrl(): string
Getter for property
uploadUrl
. Url of server we wish to upload to, only used as a fallback when FileReader is not supported by the browser
Default value is empty/undefined
Returns:
{string} | the value of property uploadUrl |
Getter for property
width
. The width of the control.
Default value is 100%
Returns:
indexOfPicture(oPicture): int
Checks for the provided sap.ca.ui.PictureItem
in the aggregation named pictures
and returns its index if found or -1 otherwise.
Parameters:
Returns:
{int} | the index of the provided control in the aggregation if found, or -1 otherwise |
Inserts a picture into the aggregation named pictures
.
Parameters:
{sap.ca.ui.PictureItem} | oPicture | the picture to insert; if empty, nothing is inserted |
{int} | iIndex | the 0 -based index the picture should be inserted at; for a negative value of iIndex , the picture is inserted at position 0; for a value greater than the current size of the aggregation, the picture is inserted at the last position |
Returns:
Removes all the controls in the aggregation named pictures
.
Additionally unregisters them from the hosting UIArea.
Returns:
Removes an picture from the aggregation named pictures
.
Parameters:
Returns:
Setter for property
buttonPageType
.
Default value is Tab
Parameters:
{string} | sButtonPageType | new value for property buttonPageType |
Returns:
Setter for property
compression
.
Default value is low
Parameters:
{string} | sCompression | new value for property compression |
Returns:
Setter for property
editable
.
Default value is true
Parameters:
{boolean} | bEditable | new value for property editable |
Returns:
Setter for property
itemSize
.
Default value is 64
Parameters:
{int} | iItemSize | new value for property itemSize |
Returns:
Setter for property
maxPictureNumber
.
Default value is 10
Parameters:
{int} | iMaxPictureNumber | new value for property maxPictureNumber |
Returns:
Setter for property
pictureAlign
.
Default value is Left
Parameters:
Returns:
setText(sValue)
Set the text for the button
Parameters:
Setter for property
uploadUrl
.
Default value is empty/undefined
Parameters:
{string} | sUploadUrl | new value for property uploadUrl |
Returns:
Setter for property
width
.
Default value is 100%
Parameters:
Returns:
Unbinder for aggregation pictures
.
Returns: