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 | ||||||
---|---|---|---|---|---|---|
| ||||||
persistent object Farmer { . . blob governmentAssistanceCertificate; . . } |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
<fileupload label="fileupload.government_assistance_recipient_certificate"> <binding variable="farmer"> <attribute name="governmentAssistanceCertificate"/> </binding> </fileupload> |
Code Block | ||||||
---|---|---|---|---|---|---|
| ||||||
Farmer farmer; void init() { farmer = Farmer:user(); } |
Code Block | ||
---|---|---|
| ||
fileupload.government_assistance_recipient_certificate = Government Assistance Recipient Certificate: |
Info | ||
---|---|---|
| ||
Additional Mentions and References
- Devoted section in the Helium Tutorial Lesson 9: CSV Upload and Parsing
- Devoted section in the Helium Tutorial Lesson 11: FileBrowser, UUID, fromString
- Helium DSL and View Quick Reference