vdl-attachment-button
Creates a button on the page that provides interaction with scenario or app attachments when pressed. The type of action must be specified with the "action" attribute.
Example
<vdl-attachment-button action="download-scenario-attachment" filename="input.xlsx">Download input spreadsheet</vdl-attachment-button>
<vdl-attachment-button action="manage-project-attachments" message="Show this message in the manage attachments dialog">Manage app attachments</vdl-attachment-button>
<vdl-attachment-button action="edit-project-attachment-properties" tag="input-data" field="description">Edit app input data description</vdl-attachment-button>
<vdl-attachment-button action="create-scenario-attachment" tag="input-data" filename="input.xml">Create new XML input</vdl-attachment-button>
Attributes
action | Specify the type of action to perform when the button is pressed. Expected values: "upload-scenario-attachment", "upload-project-attachment", "download-scenario-attachment", "download-project-attachment", "manage-scenario-attachments", "manage-project-attachments", "edit-scenario-attachment-properties", "edit-project-attachment-properties", "create-project-attachment", "create-scenario-attachment". | required | |||||||
---|---|---|---|---|---|---|---|---|---|
class | Class for attachment button, defaults to "btn btn-secondary" | ||||||||
editor | Id of the editor to open this attachment with. Expected values: ""CTAttachmentEditor", "TextAttachmentEditor", "DMNAttachmentEditor", "DecisionTableAttachmentEditor". | ||||||||
enabled | A boolean expression or a string ("true", "false") which indicates whether the field is enabled. | accepts expression | |||||||
field | Specify the form field to focus on in the attachments dialog when the action is to edit the attachment. Expected values: "filename", "description", "tags". | ||||||||
file-extension | For use with create-project-attachment and create-scenario-attachment, this specifies the extension of the file to be created. If the filename is also specified, the extension will be appended to it (separated by a dot). Otherwise, the extension will be appended to the default filename | accepts expression | |||||||
filename | Select attachment by filename. The button will perform the action on the attachment that has this filename. If there is no matching attachment then the button will be disabled. | accepts expression | |||||||
message | Message to show when opening the manage attachments dialog. Will be displayed at the bottom of the dialog. | ||||||||
on-close | On close callback for attachment editor dialog. Supplied expression receives an object with the status and attachment metadata. Expression can either be a function definition, function reference or a simple inline expression.
|
accepts expression | |||||||
scenario | Scenario id/index of this field | accepts expression | |||||||
tag | Select attachment by tag, or create attachment(s) with tag. The button will perform the action on the attachment that has this tag assigned. If there are multiple matching attachments then the first one will be used. If there is no matching attachment then the button will be disabled. |
Element contents
Markup allowed
The contents of the <vdl-attachment-button> element are used as the button text. This can include rich markup and dynamic content.