Contents
Introduction
The File Display component is used to facilitate the uploading and displaying of files in PhixFlow. Files are previewed and where this is not possible a generic placeholder image is displayed. The Serene Grey palette provides a number of templates, below is an example of the File Display form field.
File Display components require the following key items in order to function:
- A directory on the server to store the uploaded files and an entry in the System Configuration to point at this location
- A special type of table called a File Table to hold the information about the uploaded files. This is added using an ERD
Initial Setup
In order to store an uploaded file the following must be completed.
- Directory
- On your server, create a directory where the files will be uploaded. This should be accessible to the application
- In PhixFlow, from the Administration menu, open System → Configuration
- In the System Directories section → File Table Upload Location field, add the address of the directory setup in the first step, e.g. /opt/phixflow/data/file
- save your changes
- All uploaded files will now be placed in this directory
- File Table
- On your ERD, add a new File Table
- All the required attributes are added by default
- If required, create a relationship between this File Table and your desired target table. The target table will require an attribute with a Type of File in order to create a relationship
- For example, if you wish to upload company logos, create a relationship to a your company table, create a logo attribute of the type File and link to the File Table Primary key
- For example, if you wish to upload company logos, create a relationship to a your company table, create a logo attribute of the type File and link to the File Table Primary key
- Data can now be saved directly to this table or via a relationship
- On your ERD, add a new File Table
Uploading Files
- Drag the File Display component from the Serene Grey palette onto your screen
- Add a backing attribute by right-clicking on the File Display component and selecting Add Backing Attribute
- Select the Primary Key from your File Table if you are saving directly to the table or use the relational attribute (foreign key) on your related table
- Now, with your screen Locked you can drag files onto the File Display component to populate the data. This populates the field
- Ensure the File Display form field is added to your save actionflow, so the data is saved
Creating a Download Hyperlink
A text hyperlink can be created that facilitates the downloading of a file.
- On the screen that is backed by the required table, click Attributes
- Navigate the File Table and drag the Url attribute onto your screen
- A hyperlink will be created that downloads the file associated to the current record, i.e. the file for the record currently on the form
- The hyperlink component is created using the template defined in the application's Properties → Styles tab → Default Components section → Default File Url Component
Background Icons
- When the File Display is available for the user to upload a file:
- When the user is dragging a file over the File Display component:
- When the File Display is read-only, this includes when the screen is Unlocked:
These style can be changed using Formatting Rule and the new CSS Drag Over property that can be applied to a CSS Property.
Properties Tab
If this item is within or belongs to another, its parent name is shown here. See the Parent Details section on the Common Properties page for more details.Parent Details
Basic Settings
Field | Description |
---|---|
Name | Enter the name of the component. The names for some components do not support spaces such as form fields and card components. |
Aggregate Function | Facilitates the aggregation of the values held in a data backed components. See Aggregating Data. For example, sum the value for InvoiceAmount across all records to give a total. |
Allow file download | Tick to allow users to click on a File Component to download the associated file. |
Show the file name | Tick to display the name of the file associated to the File Component. |
Show preview | Tick to display a preview of the file associated to the File Component. For files where a preview is not possible, such as a CSV, a generic image is displayed which illustrates the file type, e.g. . Untick to display an appropriate holding image illustrating the file type for the record. |
Backing Attribute
Table Attribute The name of the underlying attribute. Table The name of the Table the attribute originates from. See Table. Relational Attribute Indicates if the attribute is relational. This field is read-only. See Using Relational Views.
This section includes a list of the Preferred Parent Categories the component can be dragged onto. For example, a button template can have a preferred parent category of button bar, therefore when the button template is dragged onto a screen the button bar will highlight indicating it is a preferred parent for the button template. This property relates to configuring preferred parents for components; see Component Categories and Preferred Parents. To add a category, open the repository Layout Categories section and drag one into the list.Preferred Parent Categories
Advanced Settings
Field | Description |
---|---|
Type | PhixFlow populates this property with the type of component. |
Internal Icon Source | Select an image from the list of uploaded images to be used as the icon for this component. The icon will appear alongside the name of the component in the Layers section, Repository and property editors. |
External Icon Source | Enter the path to an icon that is stored in your file system. |
Description
Field Description Tooltip Enter tooltip text. When using the application, if the user hovers their mouse over this component, PhixFlow displays this text.
If this text is in the translation table, PhixFlow can display translated text that matches the user's locale; see Translating an Application Interface.Description Enter a description to explain the purpose of this component.
Styles Tab
Shared Styles are reusable styles that can be applied to multiple components. Editing a shared style will impact all components where it is being used, therefore proceed with caution when editing and deleting. See Style. Click Show the List of Styles to see the styles available in the repository. You can drag styles from the repository into the grid to add a shared style to this component. A list of CSS properties. Click Create New to add a new CSS style; see CSS Properties. A list of rules about when to apply formatting. Click Create New to add a new rule; see Formatting Rule.Shared Styles
CSS Properties
Formatting Rules
Style Settings
PhixFlow uses the style settings to construct CSS for the component; see w3schools.com CSS for details of CSS. If the formatting you require is not available in this section, you can also create custom styling, see CSS Properties. PhixFlow applies the style to the component when you save changes to the properties tab.
Actions Tab
This section has a toolbar with standard buttons. The grid contains a list of event handlers configured for this component. Event handlers use a user action, such as a mouse-click, to trigger a table-action or actionflow to run. To add an event handler: To remove an event handler, use the toolbar button Delete.Event Handlers
A list of rules of the action drop-targets on this component. Click Create New to add a new drop-target; see Drag Types and Drop Targets.Drop Targets
See the Common Properties page, Access Permissions section. Security Tab
Access Permissions
See the Common Properties page, Audit Summary section. Audit Tab
Audit Summary