sap.ca.ui.FileUpload.extend(sClassName, oClassInfo?, FNMetaImpl?): function
Creates a new subclass of class sap.ca.ui.FileUpload 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.FileUpload.
Returns:
Attach event handler
fnFunction
to the 'beforeUploadFile' event of this
sap.ca.ui.FileUpload
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.FileUpload
.
itself. Fired just before the control is about to make a file upload request. The data passed is the file object selected by the user. You may handle this event to attach custom headers for example if your service implementation requires it.
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.FileUpload . itself. |
Returns:
Attach event handler
fnFunction
to the 'deleteFile' event of this
sap.ca.ui.FileUpload
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.FileUpload
.
itself. Fired when a file deletion event occurs typically by clicking a the delete icon. The file descriptor json for the file to be deleted is passed in the event data
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.FileUpload . itself. |
Returns:
Attach event handler
fnFunction
to the 'fileUploadFailed' event of this
sap.ca.ui.FileUpload
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.FileUpload
.
itself. Fired when a file fails to upload. The error code and response data is passed in this event. The consumer should handle the error by showing the appropriate message.
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.FileUpload . itself. |
Returns:
Attach event handler
fnFunction
to the 'renameFile' event of this
sap.ca.ui.FileUpload
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.FileUpload
.
itself. Fired when a file is renamed. The file descripter json for the file to be renamed is passed in the event data and also a property, newFilename, that contains the new filename.
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.FileUpload . itself. |
Returns:
Attach event handler
fnFunction
to the 'uploadFile' event of this
sap.ca.ui.FileUpload
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.FileUpload
.
itself. Fired when a file is uploaded and the response comes back from service. The service response for the file to be added to the list is passed in the event data and the consumer must format it in the correct json structure and pass it back to the control using commitUploadFile method.
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.FileUpload . itself. |
Returns:
Destroys the toolBar in the aggregation named toolBar
.
Returns:
Destroys the uploadProgressLabel in the aggregation named uploadProgressLabel
.
Returns:
Detach event handler
fnFunction
from the 'beforeUploadFile' event of this
sap.ca.ui.FileUpload
.
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 'deleteFile' event of this
sap.ca.ui.FileUpload
.
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 'fileUploadFailed' event of this
sap.ca.ui.FileUpload
.
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 'renameFile' event of this
sap.ca.ui.FileUpload
.
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 'uploadFile' event of this
sap.ca.ui.FileUpload
.
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 beforeUploadFile to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
Fire event deleteFile to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
Fire event fileUploadFailed to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
Fire event renameFile to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
Fire event uploadFile to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
Returns:
getAcceptRequestHeader(): string
Getter for property
acceptRequestHeader
. The Accept request header the control should use when sending the upload request
Default value is application/json
Returns:
{string} | the value of property acceptRequestHeader |
getContributor(): string
Getter for property
contributor
. Relative path in model, pointing to property that stores the name of the person who uploaded the file.
Default value is empty/undefined
Returns:
{string} | the value of property contributor |
getDeleteEnabled(): boolean
Getter for property
deleteEnabled
. Indicates whether delete functionality should be enabled
Default value is empty/undefined
Returns:
{boolean} | the value of property deleteEnabled |
getEncodeUrl(): string
Getter for property
encodeUrl
. Url of server that will base64 encode the file
Default value is empty/undefined
Returns:
{string} | the value of property encodeUrl |
getFileExtension(): string
Getter for property
fileExtension
. Relative path in model, pointing to property that stores the uploaded files extension. Note: either fileExtension or mimeType may be used, but mimeType is preferable.
Default value is empty/undefined
Returns:
{string} | the value of property fileExtension |
getFileId(): string
Getter for property
fileId
. An identifier property name that is used to uniquely reference the file on the server.
Default value is empty/undefined
Returns:
{string} | the value of property fileId |
getFileName(): string
Getter for property
fileName
. Relative path in model, pointing to property that stores the name of a file.
Default value is empty/undefined
Returns:
{string} | the value of property fileName |
getItems(): string
Getter for property
items
. The base path in the model for the control. Avoid trailing forward slashes in value, as per default value.
Default value is empty/undefined
Returns:
{string} | the value of property items |
getMimeType(): string
Getter for property
mimeType
. Relative path in model, pointing to property that stores the file's mimeType. Note: either fileExtension or mimeType may be used, but mimeType is preferable.
Default value is empty/undefined
Returns:
{string} | the value of property mimeType |
getMultipleSelectionEnabled(): boolean
Getter for property
multipleSelectionEnabled
. Indicates whether the user is allowed to select multiple file at once from his desktop
Default value is true
Returns:
{boolean} | the value of property multipleSelectionEnabled |
getRenameEnabled(): boolean
Getter for property
renameEnabled
. Indicates whether rename functionality should be enabled
Default value is empty/undefined
Returns:
{boolean} | the value of property renameEnabled |
getSequentialUploadsEnabled(): boolean
Getter for property
sequentialUploadsEnabled
. Indicates whether file uploads should occur sequentially or in parallel. The default is in parallel.
Default value is false
Returns:
{boolean} | the value of property sequentialUploadsEnabled |
getShowAttachmentsLabel(): boolean
Getter for property
showAttachmentsLabel
. Show the Attachments count label
Default value is true
Returns:
{boolean} | the value of property showAttachmentsLabel |
getShowNoData(): boolean
Getter for property
showNoData
. Show the label "No data" when the control doesn't have files
Default value is false
Returns:
{boolean} | the value of property showNoData |
getSize(): string
Getter for property
size
. Relative path in model, pointing to property that stores the size of a file.
Default value is empty/undefined
Returns:
{string} | the value of property size |
Getter for aggregation toolBar
.
Aggregation that contains the buttons for adding
Returns:
getUploadedDate(): string
Getter for property
uploadedDate
. Relative path in model, pointing to property that stores the date at which a file was uploaded.
Default value is empty/undefined
Returns:
{string} | the value of property uploadedDate |
getUploadEnabled(): boolean
Getter for property
uploadEnabled
. This property enables & disables the ability to upload a file
Default value is empty/undefined
Returns:
{boolean} | the value of property uploadEnabled |
Getter for aggregation uploadProgressLabel
.
Aggregation that displays the current number of items that are being uploaded
Returns:
getUploadUrl(): string
Getter for property
uploadUrl
. Url of server we wish to upload to
Default value is empty/undefined
Returns:
{string} | the value of property uploadUrl |
getUrl(): string
Getter for property
url
. Relative path in model, pointing to property that stores the url at which the file is stored.
Default value is empty/undefined
Returns:
{string} | the value of property url |
getUseEditControls(): boolean
Getter for property
useEditControls
. Show the edit user controls to rename and delete files (same as deleteEnabled and renameEnabled)
Default value is false
Returns:
{boolean} | the value of property useEditControls |
getUseMultipart(): boolean
Getter for property
useMultipart
. Indicates if the control should send multipart/form data request when uploading
Default value is false
Returns:
{boolean} | the value of property useMultipart |
getXsrfToken(): string
Getter for property
xsrfToken
. The XSRF token the control should use when making the upload request. If it is not set, the control will not use a security token.
Default value is empty/undefined
Returns:
{string} | the value of property xsrfToken |
Setter for property
acceptRequestHeader
.
Default value is application/json
Parameters:
{string} | sAcceptRequestHeader | new value for property acceptRequestHeader |
Returns:
Setter for property
encodeUrl
.
Default value is empty/undefined
Parameters:
{string} | sEncodeUrl | new value for property encodeUrl |
Returns:
Setter for property
fileId
.
Default value is empty/undefined
Parameters:
{string} | sFileId | new value for property fileId |
Returns:
Setter for property
multipleSelectionEnabled
.
Default value is true
Parameters:
{boolean} | bMultipleSelectionEnabled | new value for property multipleSelectionEnabled |
Returns:
Setter for property
sequentialUploadsEnabled
.
Default value is false
Parameters:
{boolean} | bSequentialUploadsEnabled | new value for property sequentialUploadsEnabled |
Returns:
Setter for property
showNoData
.
Default value is false
Parameters:
{boolean} | bShowNoData | new value for property showNoData |
Returns:
Setter for the aggregated toolBar
.
Parameters:
Returns:
Setter for the aggregated uploadProgressLabel
.
Parameters:
Returns:
Setter for property
uploadUrl
.
Default value is empty/undefined
Parameters:
{string} | sUploadUrl | new value for property uploadUrl |
Returns:
Setter for property
useMultipart
.
Default value is false
Parameters:
{boolean} | bUseMultipart | new value for property useMultipart |
Returns:
Setter for property
xsrfToken
.
Default value is empty/undefined
Parameters:
{string} | sXsrfToken | new value for property xsrfToken |
Returns:
Attach event handler
fnFunction
to the 'cancelClicked' event of this
sap.ca.ui.FileUpload
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.FileUpload
.
itself. Fired when the cancel button is clicked. The consumer may handle the event if required.
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.FileUpload . itself. |
- Deprecated:
- Since version 1.21.1. This method is deprecated now
Returns:
Attach event handler
fnFunction
to the 'saveClicked' event of this
sap.ca.ui.FileUpload
.
. When called, the context of the event handler (its
this
) will be bound to
oListener if specified otherwise to this sap.ca.ui.FileUpload
.
itself. Fired when the save button is clicked. The consumer should handle the event and save all the file renames to backend.
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.FileUpload . itself. |
- Deprecated:
- Since version 1.21.1. This method is deprecated now. The rename or delete event is enough and should be use to commit the action immediatly
Returns:
Destroys the attachmentNumberLabel in the aggregation named attachmentNumberLabel
.
- Deprecated:
- Since version 1.21.0. This aggregation is deprecatd now. The label is part of the ToolBar
Returns:
Detach event handler
fnFunction
from the 'cancelClicked' event of this
sap.ca.ui.FileUpload
.
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. |
- Deprecated:
- Since version 1.21.1. This method is deprecated now
Returns:
Detach event handler
fnFunction
from the 'saveClicked' event of this
sap.ca.ui.FileUpload
.
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. |
- Deprecated:
- Since version 1.21.1. This method is deprecated now. The rename or delete event is enough and should be use to commit the action immediatly
Returns:
Fire event cancelClicked to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
- Deprecated:
- Since version 1.21.1. This method is deprecated now
Returns:
Fire event saveClicked to attached listeners.
Parameters:
{Map} | mArguments? | the arguments to pass along with the event. |
- Deprecated:
- Since version 1.21.1. This method is deprecated now. The rename or delete event is enough and should be use to commit the action immediatly
Returns:
getEditMode(): boolean
Getter for property
editMode
. Property to allow toggling between edit and view screens.
Default value is false
- Deprecated:
- Since version 1.21.0. This method is deprecatd now. If you want to prevent edit you can use useEditControls property or the deleteEnabled, renameEnabed and uploadEnabled properties
Returns:
{boolean} | the value of property editMode |
getShowAttachmentsLabelInEditMode(): boolean
Getter for property
showAttachmentsLabelInEditMode
. Show the Attachments label in edit mode
Default value is true
- Deprecated:
- Since version 1.21.0. This method is deprecated now. Use the showAttachmentsLabel instead
Returns:
{boolean} | the value of property showAttachmentsLabelInEditMode |
Setter for the aggregated attachmentNumberLabel
.
Parameters:
- Deprecated:
- Since version 1.21.0. This aggregation is deprecatd now. The label is part of the ToolBar
Returns: