FileDownload is used to load files from the server onto the client. The data property determines the data source in the view context. The target property determines the ID of the target window in the browser.
Files from a FileDownload UI element are accessed when the user initiates a request for a specific file, that is, when the user clicks on a link.This way of accessing files enables large data sets to be processed.
For this access procedure, the FileDownload.data property must be linked to a context node that meets the following criteria:
This ensures that the supply function is not called until the user requests the data. To use the supply function in a table you need such a node within your Table.dataSource node.
Note that this does not concern a singleton, as this could lead to short dumps in your application.
To avoid having unnecessary data in the context, the FileDownload node is invalidated after the download. This however only happens if the node was not made available before the download.Consequently no data can get lost.
To find out how to download a file without using the UI element, see File Export .
To enable the development of accessible applications, the tooltip property is checked during the syntax check if the text and label properties are not set.
A tooltip does not necessarily have to be set for this UI element, but it could make sense to set it if it contains detailed semantic information.
Runtime Class |
CL_WD_FILE_DOWNLOAD |
Properties in the View Designer
Name | Type | Initial Value | Bindable |
---|---|---|---|
STRING |
(automatic) |
No |
|
WDY_BOOLEAN |
false |
No |
|
WDUI_FILE_DOWNLOAD_BHVR |
auto |
Yes |
|
WDUI_CONTEXT_MENU_BEHAVIOUR |
inherit |
No |
|
WDY_MD_UI_ELEMENT_REFERENCE |
No |
||
XSTRING |
Yes |
||
WDUI_LINK_DESIGN |
standard |
Yes |
|
WDY_BOOLEAN |
true |
Yes |
|
STRING |
Yes |
||
WDY_BOOLEAN |
true |
Yes |
|
STRING |
Yes |
||
STRING |
Yes |
||
STRING |
Yes |
||
STRING |
Yes |
||
STRING |
Yes |
||
Translatable text |
Yes |
||
WDUI_TEXT_DIRECTION |
inherit |
Yes |
|
Translatable text |
Yes |
||
WDUI_LINK_TYPE |
navigation |
Yes |
|
WDUI_VISIBILITY |
visible |
Yes |
|
WDY_BOOLEAN |
false |
Yes |
Other properties that can be inherited are defined in the associated higher-level classes. The associated UI elements are:
Dynamic Programming of Properties
For dynamic programming, the same properties, events, and aggregations as in the View Designer are available. Bear in mind the different spellings.
View Designer Name | Runtime Name | Type |
---|---|---|
ACTIVATE_ACCESS_KEY |
WDY_BOOLEAN |
|
BEHAVIOUR |
WDUI_FILE_DOWNLOAD_BHVR |
|
behaviour: allowSave |
CL_WD_FILE_DOWNLOAD=>E_BEHAVIOUR-ALLOW_SAVE |
|
behaviour: auto |
CL_WD_FILE_DOWNLOAD=>E_BEHAVIOUR-AUTO |
|
behaviour: openInplace |
CL_WD_FILE_DOWNLOAD=>E_BEHAVIOUR-OPEN_INPLACE |
|
CONTEXT_MENU_BEHAVIOUR |
WDUI_CONTEXT_MENU_BEHAVIOUR |
|
contextMenuBehaviour: inherit |
CL_WD_FILE_DOWNLOAD=>E_CONTEXT_MENU_BEHAVIOUR-INHERIT |
|
contextMenuBehaviour: provide |
CL_WD_FILE_DOWNLOAD=>E_CONTEXT_MENU_BEHAVIOUR-PROVIDE |
|
contextMenuBehaviour: suppress |
CL_WD_FILE_DOWNLOAD=>E_CONTEXT_MENU_BEHAVIOUR-SUPPRESS |
|
CONTEXT_MENU_ID |
WDY_MD_UI_ELEMENT_REFERENCE |
|
DATA |
XSTRING |
|
DESIGN |
WDUI_LINK_DESIGN |
|
design: emphasized |
CL_WD_FILE_DOWNLOAD=>E_DESIGN-EMPHASIZED |
|
design: standard |
CL_WD_FILE_DOWNLOAD=>E_DESIGN-STANDARD |
|
ENABLED |
WDY_BOOLEAN |
|
FILE_NAME |
STRING |
|
IMAGE_FIRST |
WDY_BOOLEAN |
|
IMAGE_HEIGHT |
STRING |
|
IMAGE_SOURCE |
STRING |
|
IMAGE_WIDTH |
STRING |
|
MIME_TYPE |
STRING |
|
TARGET |
STRING |
|
TEXT |
WDY_MD_TRANSLATABLE_TEXT |
|
TEXT_DIRECTION |
WDUI_TEXT_DIRECTION |
|
textDirection inherit |
CL_WD_FILE_DOWNLOAD=>E_TEXT_DIRECTION-INHERIT |
|
textDirection ltr |
CL_WD_FILE_DOWNLOAD=>E_TEXT_DIRECTION-LTR |
|
textDirection rtl |
CL_WD_FILE_DOWNLOAD=>E_TEXT_DIRECTION-RTL |
|
TOOLTIP |
WDY_MD_TRANSLATABLE_TEXT |
|
TYPE |
WDUI_LINK_TYPE |
|
type: function |
CL_WD_FILE_DOWNLOAD=>E_TYPE-FUNCTION |
|
type: navigation |
CL_WD_FILE_DOWNLOAD=>E_TYPE-NAVIGATION |
|
type: reporting |
CL_WD_FILE_DOWNLOAD=>E_TYPE-REPORTING |
|
type: result |
CL_WD_FILE_DOWNLOAD=>E_TYPE-RESULT |
|
VISIBLE |
WDUI_VISIBILITY |
|
visible: none |
CL_WD_FILE_DOWNLOAD=>E_VISIBLE-NONE |
|
visible: visible |
CL_WD_FILE_DOWNLOAD=>E_VISIBLE-VISIBLE |
|
WRAPPING |
WDY_BOOLEAN |
data file type string. data dot_offset type i. data extension type mimetypes-extension. data mimetype type mimetypes-type. file = 'Image.jpg'. " Find out file name extension find first occurrence of regex '\.[^\.]+$' in file match offset dot_offset. add 1 to dot_offset. extension = file+dot_offset. " Get mime type call function 'SDOK_MIMETYPE_GET' exporting extension = extension importing mimetype = mimetype.
You can find examples of this interface element in the system in the Web Dynpro application WDR_TEST_UI_ELEMENTS, and in the component WDR_TEST_EVENTS in the View FileDownload.