Appearance
Files
Purpose
Use a files panel to browse, preview, download, and maintain files linked to the object selected in another panel.
When to use
Choose filesList for a paged grid with per-file controls. Choose preview for an always-visible document viewer. Use a file panel only when another panel publishes an object-selection event; it is not a general file repository.
Prerequisites and ownership
request.getSelectedObjectForEventIdmust identify an event that supplies an object GUID.- The panel store loads
Datasetlinks of the selected object, resolves their file metadata, and resets when selection clears. - The panel owns data acquisition and file mutation calls.
@mes/aps-document-viewerowns document rendering in the preview surface.filesList.actionsare row actions. Upload belongs inpanelActions.
Capability map
| Area | Supported behavior |
|---|---|
| Binding | Watches the configured selection event and reloads linked datasets when the object changes |
| List mode | Paged responsive grid, optional fixed column count, filename/size/MIME/modified metadata |
| Previews | Optional card thumbnails prepared by the server; eye action opens a modal gallery in list mode |
| Preview mode | In-place gallery for all files linked to the selected object, one open file at a time |
| Download | Always-visible download action that saves the original file; fileDownload.useModernApi asks the browser for a save dialog once the file is downloaded, where supported and while the click still counts as a user action; otherwise the browser saves the file as usual |
| Row maintenance | deleteFile, editDatasetMeta, replaceDatasetFile (keeps the file GUID), and unlinkDataset through filesList.actions |
| Header actions | Common panelActions, including uploadFile, rendered above the content |
| States | Loading spinner and localized empty message |
Behavioral model
Selection produces an object GUID. The store fetches links and file metadata, formats one view model per dataset, and renders either the list or preview surface. Clearing selection clears the panel. Mutations refresh the linked datasets; preview index and modal state stay panel-local.
Every file request carries the user's token, so the panel downloads content itself instead of handing a plain link to the browser:
- Card thumbnail. When
showPreviewsis on and the server reports the thumbnail as ready, the card requestsGET /files/{guid}/thumbnailand shows it. Otherwise the card shows the file type, for examplePDF. A thumbnail that the server is still preparing appears the next time the panel loads its file list: when an object is selected, and after a file is uploaded, replaced, deleted, or unlinked or its metadata is edited. - Gallery. The gallery downloads only the open file. The arrows above the viewer open the previous or next file and download it then.
- Download. The download action always saves the original file, never its thumbnail.
- Replace.
replaceDatasetFileuploads new content into the same file. The file GUID does not change, and earlier content cannot be opened or restored from the panel. Every card of this panel shows the new content at once; another panel that shows the same file shows it after its list is loaded again.
Alternatives, defaults, and precedence
variantis required:filesListorpreview.- List page sizes default to
[4, 5, 10, 15]; the first value is the initial page size. - Without
grid.itemsInRow, CSS chooses a responsive number of columns. showPreviewscontrols thumbnails in list cards, not the eye action or dedicatedpreviewmode.fileDownload.useModernApidefaults tofalse.
Limitations
- No selected object means no rendered file content.
- The panel has a fixed linked-data acquisition strategy; JSON does not define a custom file request.
filesList.actionsmust not containuploadFile: row actions have a file and dataset context, while upload is a header action for the selected object.- Preview support depends on MIME type and the installed viewer. Word, Excel, and PowerPoint files are not rendered by the viewer.
- Opening a gallery file downloads the whole file, up to 1 GiB, before the viewer shows it. The viewer receives one file at a time, so its thumbnail strip and arrow-key navigation are not available; use the arrows above it.
Minimal configuration
json
{
"id": "files",
"type": "files",
"request": {
"getSelectedObjectForEventId": "orders--selected"
},
"variant": "filesList"
}Scenario: maintain files for a selected order
json
{
"id": "order-files",
"type": "files",
"ui": { "title": "Attachments" },
"request": {
"getSelectedObjectForEventId": "orders--selected"
},
"variant": "filesList",
"fileDownload": { "useModernApi": false },
"filesList": {
"showPreviews": true,
"pagination": { "rowsPerPage": [6, 12, 24] },
"grid": { "itemsInRow": 3 },
"actions": [
{ "id": "edit-file-metadata", "method": "editDatasetMeta", "label": "Edit metadata", "icon": "pencil" },
{ "id": "replace-file", "method": "replaceDatasetFile", "label": "Replace", "icon": "upload" },
{ "id": "unlink-file", "method": "unlinkDataset", "label": "Unlink", "icon": "times" },
{ "id": "delete-file", "method": "deleteFile", "label": "Delete", "icon": "trash" }
]
},
"panelActions": [
{ "id": "upload-file", "method": "uploadFile", "label": "Upload", "icon": "plus" }
]
}Expected result: selecting an order loads its linked files, upload acts on the selected order, and each row action acts on that row's file/dataset.
Runnable demos
Open the shared configurator journeysOpen the Files tab and select any order. The real Files store requests ObjectToDataSetLink, loads two linked Dataset objects, then calls GET /files/:guid/params for their MIME type, name, size, timestamps, and thumbnail state. The cards request GET /files/:guid/thumbnail; the eye and download actions request GET /files/:guid for the original bytes.
This fixture deliberately has no upload or row-mutation actions. It proves selection binding, filesList, previews, pagination, grid columns, metadata, and read/download transport without pretending to cover destructive behavior.
Exact parameter reference
- selection event
- browser save dialog
- list or preview variant
- card previews
- page sizes
- grid columns
- row actions
- header actions
Related guides and next task
Next, copy the selection/list configuration. Add upload or row mutations only after their deployed file and Dataset contracts are verified separately.