File
Overview
Use the File control to allow users to pick a single file from their computer, and instead of the Multifile control, when you want to only allow one file attachment in a dialog.
Example
The following is an example:
<File caption="ids.attachment.add.toolTip" valueCaption="fileName" valueIcon="attachment fileName" data="data" head="true" value="attachment" lazy="false" name="file"/>
The important properties to note are:
- value - a complex attribute from the class to which the containing layout is bound. The attribute should not be a collection. This example uses
attachment
, which is an attribute forTask
of type ActAttachment. - valueCaption - the caption for the displayed attachment chip, and is often the file name. This is an attribute on the returned object as configured in the value property.
- valueIcon - the icon based on the file extension for the displayed attachment chip.
- data - the data of the file attachment. This is an attribute on the returned object as configured in the value property.
Explanations
When the lazy
property is set to true
, the data for the attachment is uploaded only after a dialog is closed. When the lazy
property is set to false
, the attachment is uploaded as soon as it is confirmed as selected.
If the attachment instance is associated with the parent class through an association class, then setting lazy=false
is recommended. This makes the attachment data available for use when the intersection class instances are created.
More details
More information about specific properties for the File control can be found in the Model Description Language Reference.