Note: Application logic should not interact with the component's properties or invoke its methods until the BusyContext indicates that the component is ready for interaction.
Slots
JET components that allow child content support slots. Please see the slots section of the JET component overview doc for more information on allowed slot content and slot types.
Attributes
-
accept :Array.<string>|null
-
An array of strings of allowed MIME types or file extensions that can be uploaded; this is unlike the accept attribute of the html <input> element that accepts a simple comma-delimited string. If not specified, accept all file types.
Note: If accept is specified, files with empty string type will be rejected if no match found in the "accept" value.
- Default Value:
null
Names
Item Name Property acceptProperty change event acceptChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-accept-changed -
disabled :boolean
-
Disables the filepicker if set to
true.- Default Value:
false
Names
Item Name Property disabledProperty change event disabledChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-disabled-changed -
select-on :"auto"|"click"|"drop"|"clickAndDrop"
-
The type of event to select the files.
- Default Value:
"auto"
Supported Values:
Value Description "auto"either click or drag and drop to select the files "click"click to select the files "clickAndDrop"either click or drag and drop to select the files "drop"drag and drop the files Names
Item Name Property selectOnProperty change event selectOnChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-select-on-changed -
selection-mode :"multiple"|"single"
-
Whether to allow single or multiple file selection.
- Default Value:
"multiple"
Supported Values:
Value Description "multiple"multiple file selection "single"single file selection Names
Item Name Property selectionModeProperty change event selectionModeChangedProperty change listener attribute (must be of type function, see Events and Listeners for additional information.) on-selection-mode-changed
Events
-
ojBeforeSelect
-
Triggered before files are selected to allow for custom validation
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description filesFileList The selected files accept(acceptPromise:Promise<void>) => void To perform custom validation, the application should call the accept function and pass in a Promise. The Promise should be resolved to accept the current selection, otherwise it should be rejected with an Array<oj.ojMessage.Message> describing the reasons for rejection. -
ojInvalidSelect
-
Triggered when invalid files are selected. This event provides the application with a list of messages that should be displayed to give the user feedback about the problems with their selection. This feedback can be safely cleared when a subsequent ojBeforeSelect, ojInvalidSelect, or ojSelect event is received. Additionally the event.detail.until property may be populated with a Promise to provide short-term feedback during a user interaction (typically drag and drop); the feedback should be cleared upon resolution of this Promise.
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description messagesArray.<oj.ojMessage.Message> Messages that should be displayed to the user (e.g. in an oj-messages component) describing invalid files. untilPromise.<void> | null This property may be populated with a Promise to provide short-term feedback during a user interaction (typically drag and drop); the feedback should be cleared upon the resolution of this Promise. -
ojSelect
-
Triggered after the files are selected
Properties:
All of the event payloads listed below can be found under
event.detail. See Events and Listeners for additional information.Name Type Description filesFileList The files that were just selected.
Methods
-
getProperty(property) : {any}
-
Retrieves a value for a property or a single subproperty for complex properties.
Parameters:
Name Type Description propertystring The property name to get. Supports dot notation for subproperty access. Returns:
- Type
- any
-
setProperties(properties) : {void}
-
Performs a batch set of properties.
Parameters:
Name Type Description propertiesObject An object containing the property and value pairs to set. Returns:
- Type
- void
-
setProperty(property, value) : {void}
-
Sets a property or a single subproperty for complex properties and notifies the component of the change, triggering a [property]Changed event.
Parameters:
Name Type Description propertystring The property name to set. Supports dot notation for subproperty access. valueany The new value to set the property to. Returns:
- Type
- void