X4 Produktdokumentation

FileLink

<FileLink> controls are used to include links to download a file from the server to the client. The file can be provided either via a Technical Process using the process attribute or directly via a previously bound Base64 property with the data attribute.

Instructions for use

A <FileLink> control is created with the <FileLink> element.

<FileLink>
...
</FileLink>

<FileLink> controls can be used in all available layout types: For more information, see Layouts.

Attribute

Note:

There are a number of default attributes that can be set for all controls. For more information about the default attributes, see Default attributes.

In addition to the default attributes, you can define the following attributes for <FileLink> controls.

Attribute

Description

data

Use only if a Base64 file is offered for download!

Specifies which file to download.

Possible values: String for data binding

The data binding expression must refer to a property of type base64!

displayName

Name of the file that is displayed in the Web App and is assigned as the file name for the downloaded file.

  • Translatable

  • Data binding possible

Possible values:

Any string including file extension

fileId

Identifier that can be used by the process developer.

  • Data binding possible

Possible values:

Any string

fileName

Required

Identifier for the Technical Process that supplies the data.

  • Translatable

  • Data binding possible

Possible values:

Any string

process

Technical Process that delivers the file.

Possible values:

String (URI)

Example

The following example, with a file download from a static resource, shows how to use the <FileLink> tag. The 1.pdf file, which is to be made available for download, is located directly in the Resources folder and is delivered via the Technical Process process_1.wrf in the Services/Processes folder. Both a file and a Technical Process must exist for download.

FileLink control in the Detail Component
XML
<DetailComponent path="Dashboard" displayName="Dashboard" default="true">
    <FlowLayout>
        <TextBox value="You can download your profile data as a digital business card." textOverflow="hidden"/>
        <FileLink process="process_1.wrf" fileName="1.pdf" displayName="Download digital business card"/>
    </FlowLayout>
</DetailComponent>

The file link is defined in the web app definition above. For FileLink, a Technical Process is stored that supplies the file (process_1.wrf). A display name is assigned (displayName="example.pdf"), which is used as text in the Web App and as the file name of the download. The fileName attribute is not relevant in this example. This attribute can be used in more complex applications because it is returned to the processing Technical Process by the control.

Input FileLink
XML
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<fileId>1.pdf</fileId>
image-20251117-132313.png