Options
All
  • Public
  • Public/Protected
  • All
Menu

The configuration for the FileUpload widget. You can access this configuration via BaseWidget.cfg. Please note that this configuration is usually meant to be read-only and should not be modified.

Hierarchy

Index

Properties

allowTypes: RegExp

Regular expression for accepted file types.

auto: boolean

When set to true, selecting a file starts the upload process implicitly.

behaviors: Record<string, Behavior>

A map with all behaviors that were defined for this widget. The key is the name of the behavior, the value is the callback function that is invoked when the behavior is called.

disabled: boolean

Whether this file upload is disabled.

dnd: boolean

Whether drag and drop is enabled.

dropZone: string

Custom drop zone to use for drag and drop.

formId?: string

ID of the form to use for AJAX requests.

global: boolean

Global AJAX requests are listened to by ajaxStatus. When false, ajaxStatus will not get triggered.

id: string | string[]

The client-side ID of the widget, with all parent naming containers, such as myForm:myWidget. This is also the ID of the container HTML element for this widget. In case the widget needs multiple container elements (such as Paginator), this may also be an array if IDs.

maxChunkSize: number

To upload large files in smaller chunks, set this option to a preferred maximum chunk size. If set to 0, null or undefined, or the browser does not support the required Blob API, files will be uploaded as a whole.

maxRetries: number

Only for chunked file upload: Amount of retries when upload gets interrupted due to e.g. an unstable network connection.

messageTemplate: string

Message template to use when displaying file validation errors.

Callback invoked when an uploaded file is added.

Callback that is invoked when a file upload was canceled.

oncomplete: OnCompleteCallback

Callback that is invoked after a file was uploaded to the server successfully.

Callback that is invoked when a file could not be uploaded to the server.

Callback that is invoked at the beginning of a file upload, when a file is sent to the server.

Callback to execute before the files are sent. If this callback returns false, the file upload request is not started.

postConstruct: PostConstructCallback

An optional callback that is invoked after this widget was created successfully, at the end of the init method. This is usually specified via the widgetPostConstruct attribute on the JSF component. Note that this is also called during a refresh (AJAX update).

postRefresh: PostRefreshCallback

An optional callback that is invoked after this widget was refreshed after an AJAX update, at the end of the refresh method. This is usually specified via the widgetPostRefresh attribute on the JSF component.

preDestroy: PreDestroyCallback

An optional callback that is invoked before this widget is about to be destroyed, e.g., when the component was removed at the end of an AJAX update. This is called at the beginning of the destroy method. This is usually specified via the widgetPreDestroy attribute on the JSF component.

previewWidth: number

Width for image previews in pixels.

process: string

Component(s) to process in fileupload request.

resumeContextPath: string

Server-side path which provides information to resume chunked file upload.

retryTimeout: number

Only for chunked file upload: (Base) timeout in milliseconds to wait until the next retry. It is multiplied with the retry count. (first retry: retryTimeout * 1, second retry: retryTimeout * 2, ...)

sequentialUploads: boolean

true to upload files one after each other, false to upload in parallel.

update: string

Component(s) to update after fileupload completes.

widgetVar: string

The name of the widget variables of this widget. The widget variable can be used to access a widget instance by calling PF("myWidgetVar").

Generated using TypeDoc