Upload

open class Upload(uploadUrl: String?, multiple: Boolean, label: String?, rich: Boolean, init: Upload.() -> Unit?)

The form field file upload component.

Parameters

uploadUrl

the optional URL for the upload processing action

multiple

determines if multiple file upload is supported

label

label text bound to the input element

rich

determines if label can contain HTML code

init

an initializer extension function

Constructors

Upload
Link copied to clipboard
fun Upload(uploadUrl: String? = null, multiple: Boolean = false, label: String? = null, rich: Boolean = false, init: Upload.() -> Unit? = null)

Types

Companion
Link copied to clipboard
object Companion

Functions

blur
Link copied to clipboard
open fun blur()
buildClassSet
Link copied to clipboard
open fun buildClassSet(classSetBuilder: <ERROR CLASS>)
cancel
Link copied to clipboard
open fun cancel()

Cancel an ongoing ajax upload (only for ajax mode).

clearInput
Link copied to clipboard
open fun clearInput()

Clears the file input control (including the native input).

focus
Link copied to clipboard
open fun focus()
getNativeFile
Link copied to clipboard
open fun getNativeFile(kFile: <ERROR CLASS>): <ERROR CLASS>?

Returns the native JavaScript File object.

getState
Link copied to clipboard
open fun getState(): List<<ERROR CLASS>>?
getValueAsString
Link copied to clipboard
open fun getValueAsString(): String?
lock
Link copied to clipboard
open fun lock()

Locks the file input (disabling all buttons except a cancel button).

removeEventListener
Link copied to clipboard
open fun removeEventListener(id: Int): <ERROR CLASS>
removeEventListeners
Link copied to clipboard
open fun removeEventListeners(): <ERROR CLASS>
resetInput
Link copied to clipboard
open fun resetInput()

Resets the file input control.

setEventListener
Link copied to clipboard
open fun <T> setEventListener(block: <ERROR CLASS><T>.() -> Unit): Int
setState
Link copied to clipboard
open fun setState(state: List<<ERROR CLASS>>?)
subscribe
Link copied to clipboard
open fun subscribe(observer: (List<<ERROR CLASS>>?) -> Unit): () -> Unit
unlock
Link copied to clipboard
open fun unlock()

Unlocks the file input.

upload
Link copied to clipboard
open fun upload()

Trigger ajax upload (only for ajax mode).

Properties

allowedFileExtensions
Link copied to clipboard
var allowedFileExtensions: Set<String>?

Allowed file extensions.

allowedFileTypes
Link copied to clipboard
var allowedFileTypes: Set<String>?

Allowed file types.

browseOnZoneClick
Link copied to clipboard
var browseOnZoneClick: Boolean

Determines if the click on the preview zone opens file browse window.

dropZoneEnabled
Link copied to clipboard
var dropZoneEnabled: Boolean

Determines if Drag&Drop zone is enabled.

explorerTheme
Link copied to clipboard
var explorerTheme: Boolean

Determines if the explorer theme is used.

flabel
Link copied to clipboard
val flabel: <ERROR CLASS>
input
Link copied to clipboard
val input: UploadInput
invalidFeedback
Link copied to clipboard
val invalidFeedback: <ERROR CLASS>
label
Link copied to clipboard
var label: <ERROR CLASS>

The label text bound to the spinner input element.

multiple
Link copied to clipboard
var multiple: Boolean

Determines if multiple file upload is supported.

placeholder
Link copied to clipboard
var placeholder: String?

The placeholder for the upload control.

preferIconicPreview
Link copied to clipboard
var preferIconicPreview: Boolean

Determines if the iconic preview is prefered.

required
Link copied to clipboard
var required: Boolean

Determines if the input selection is required.

rich
Link copied to clipboard
var rich: <ERROR CLASS>

Determines if label can contain HTML code.

showBrowse
Link copied to clipboard
var showBrowse: Boolean

Determines if the file browse button is shown.

showCancel
Link copied to clipboard
var showCancel: Boolean

Determines if the cancel button is shown.

showCaption
Link copied to clipboard
var showCaption: Boolean

Determines if the caption is shown.

showPreview
Link copied to clipboard
var showPreview: Boolean

Determines if the preview is shown.

showRemove
Link copied to clipboard
var showRemove: Boolean

Determines if the remove button is shown.

showUpload
Link copied to clipboard
var showUpload: Boolean

Determines if the upload button is shown.

uploadExtraData
Link copied to clipboard
var uploadExtraData: (String, Int) -> dynamic?

The extra data that will be passed as data to the AJAX server call via POST.

uploadUrl
Link copied to clipboard
var uploadUrl: String?

The optional URL for the upload processing action. If not set the upload button action will default to form submission.

value
Link copied to clipboard
open var value: List<<ERROR CLASS>>?

File input value.