Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Table of Contents


Description

The file upload widget is a labelled input widget that allows users to upload files and bind the uploaded values to blob unit variables or object instance attributes. 

Specifying a file to upload can be done by browsing the file system on your pc. This behaviour is triggered by clicking the folder icon on the top right corner of the widget.

In addition, a file can be dragged and dropped in the widget area labelled as "Drag & drop here"

When uploading a file, the progress is indicated by a progress bar. 

Once a file has been uploaded the file name will be displayed in the widget.

Files that have been uploaded but not yet submitted can be removed from the widget using the trash can icon on the bottom right corner of the widget.

The title is specified as a key to a lang file entry and is required. A tooltip can also be specified as a key to a lang file entry but is optional. Visibility bindings are also supported.

A new addition in version 1.57.0 (specific to the new UI) is the description attribute. The description attribute works similarly to the title in that it is specified as a key to a lang file entry, however, its purpose is to allow for additional information related to an input and will appear beneath the input.


Example

The abbreviated code snippets and screenshot below shows the use of <fileupload/> with a value binding to an object instance attribute.

Code Block
languagejava
titleModel object attribute
linenumberstrue
persistent object Farmer {
    .
    .
    blob governmentAssistanceCertificate;    
    .
    .
}


Code Block
languagexml
titleView XML
linenumberstrue
 <fileupload label="fileupload.government_assistance_recipient_certificate">
    <binding variable="farmer">
        <attribute name="governmentAssistanceCertificate"/>
    </binding>
</fileupload>


Code Block
languagejava
titleBacking unit
linenumberstrue
Farmer farmer;
void init() {
    farmer = Farmer:user();
}


Code Block
titleen.lang file entry
fileupload.government_assistance_recipient_certificate = Government Assistance Recipient Certificate:


Info
title<fileupload> example screenshots




Additional Mentions and References