Class FileUploadItem
- All Implemented Interfaces:
HasHandlers,HasBlurHandlers,HasCanEditChangedHandlers,HasChangedHandlers,HasChangeHandlers,HasClickHandlers,HasDoubleClickHandlers,HasEditorEnterHandlers,HasEditorExitHandlers,HasFocusHandlers,HasIconClickHandlers,HasIconKeyPressHandlers,HasItemHoverHandlers,HasKeyDownHandlers,HasKeyPressHandlers,HasKeyUpHandlers,HasPendingStatusChangedHandlers,HasPickerIconClickHandlers,HasReadOnlyDisplayChangedHandlers,HasShowContextMenuHandlers,HasShowValueHandlers,HasTitleClickHandlers,HasTitleDoubleClickHandlers,HasTitleHoverHandlers,HasValueHoverHandlers,HasValueIconClickHandlers
A FileUploadItem's canvas is a FileDropZone. The value of a FileUploadItem is the JavaScript File object(s) representing files the user added.
FileUploadItem is not the default for binary type fields. To use FileUploadItem for binary fields, set DynamicForm.useFileUploadItem to true on the form, or specify editorType:"FileUploadItem" on the field.
When the form is saved, files are uploaded automatically. Use DynamicForm.showUploadProgress to display upload progress.
Single File Upload
With the default setting of multiple:false, a FileUploadItem allows uploading a single file to a binary field on the DataSource. This is analogous to the standard FileItem.
Multiple File Upload
To upload multiple files, set multiple:true and configure a DataSource property pointing to a related DataSource that will store the files. This follows the same master-detail pattern as MultiFileItem:
- The form's DataSource is the "master" record (e.g., an email message)
- The FileUploadItem's
DataSourceis the "detail" DataSource storing files (e.g., email attachments) - The detail DataSource must have a
foreignKeylinking to the master DataSource's primary key - Each uploaded file creates a separate record in the detail DataSource
See MultiFileItem for an example of the DataSource setup required.
Multiple Binary Fields
A form can contain multiple FileUploadItems for different binary fields in the same DataSource. When the form is saved, all files are uploaded in a single request, creating one record with all binary fields populated. This differs from FileItem which has a limitation preventing multiple file uploads in a single form submission.
Note: If you want immediate upload on drop (like Gmail attachments), use a FormItem.changed() handler to call DynamicForm.saveData().
-
Nested Class Summary
Nested classes/interfaces inherited from class com.smartgwt.client.widgets.form.fields.FormItem
FormItem.CustomStateGetter, FormItem.StateCustomizer -
Field Summary
Fields inherited from class com.smartgwt.client.widgets.form.fields.FormItem
configOnly, scClassName, warnOnEditorTypeConversion, warnOnEditorTypeConversionDefaultFields inherited from class com.smartgwt.client.core.RefDataClass
idFields inherited from class com.smartgwt.client.core.DataClass
factoryCreated, factoryProperties -
Constructor Summary
ConstructorsConstructorDescriptionFileUploadItem(JavaScriptObject jsObj) FileUploadItem(String name) FileUploadItem(String name, String title) -
Method Summary
Modifier and TypeMethodDescriptionvoidstatic voidchangeAutoChildDefaults(String autoChildName, Canvas defaults) Changes the defaults for Canvas AutoChildren namedautoChildName.static voidchangeAutoChildDefaults(String autoChildName, FormItem defaults) Changes the defaults for FormItem AutoChildren namedautoChildName.static voidchangePickerIconDefaults(FormItemIcon defaults) voidString[]CustomcancelButtonTitlefor this fileUploadItem's canvas.TheFileDropZonecomponent that provides the drag-drop file selection UI.The class to use for theCanvasautoChild.Default properties for theCanvasautoChild FileDropZone.CustomclickToAddMessagefor this fileUploadItem's canvas.DataSource where files are stored whenmultiple:true.DataSource where files are stored whenmultiple:true.CustomduplicateFileNameMessagefor this fileUploadItem's canvas.CustomemptyDropAreaMessagefor this fileUploadItem's canvas.voidgetFiles()CustominvalidFileTypeMessagefor this fileUploadItem's canvas.CustommaxFilesErrorMessagefor this fileUploadItem's canvas.CustommaxFileSizeErrorMessagefor this fileUploadItem's canvas.SeeFileDropZone.maxSize.CustommaxSizeErrorMessagefor this fileUploadItem's canvas.SeeFileDropZone.minSize.CustomminSizeErrorMessagefor this fileUploadItem's canvas.Whether this FileUploadItem allows multiple files to be selected.CustommultipleFilesErrorMessagefor this fileUploadItem's canvas.static FileUploadItemgetOrCreateRef(JavaScriptObject jsObj) CustomprocessingMessagefor this fileUploadItem's canvas.voidgetSize()setAcceptedFileTypes(String... acceptedFileTypes) setCanAddFilesOnClick(Boolean canAddFilesOnClick) setCancelButtonTitle(String cancelButtonTitle) CustomcancelButtonTitlefor this fileUploadItem's canvas.setCanvasConstructor(String canvasConstructor) The class to use for theCanvasautoChild.setCanvasDefaults(Map canvasDefaults) Default properties for theCanvasautoChild FileDropZone.setClickToAddMessage(String clickToAddMessage) CustomclickToAddMessagefor this fileUploadItem's canvas.setDataSource(DataSource dataSource) DataSource where files are stored whenmultiple:true.setDataSource(String dataSource) DataSource where files are stored whenmultiple:true.static voidsetDefaultProperties(FileUploadItem fileUploadItemProperties) Class level method to set the default properties of this class.setDuplicateFileNameMessage(String duplicateFileNameMessage) CustomduplicateFileNameMessagefor this fileUploadItem's canvas.setEmptyDropAreaMessage(String emptyDropAreaMessage) CustomemptyDropAreaMessagefor this fileUploadItem's canvas.voidsetInvalidFileTypeMessage(String invalidFileTypeMessage) CustominvalidFileTypeMessagefor this fileUploadItem's canvas.setMaxFiles(Integer maxFiles) setMaxFilesErrorMessage(String maxFilesErrorMessage) CustommaxFilesErrorMessagefor this fileUploadItem's canvas.setMaxFileSize(Integer maxFileSize) setMaxFileSizeErrorMessage(String maxFileSizeErrorMessage) CustommaxFileSizeErrorMessagefor this fileUploadItem's canvas.setMaxSize(Integer maxSize) SeeFileDropZone.maxSize.setMaxSizeErrorMessage(String maxSizeErrorMessage) CustommaxSizeErrorMessagefor this fileUploadItem's canvas.setMinSize(Integer minSize) SeeFileDropZone.minSize.setMinSizeErrorMessage(String minSizeErrorMessage) CustomminSizeErrorMessagefor this fileUploadItem's canvas.setMultiple(Boolean multiple) Whether this FileUploadItem allows multiple files to be selected.setMultipleFilesErrorMessage(String multipleFilesErrorMessage) CustommultipleFilesErrorMessagefor this fileUploadItem's canvas.setProcessingMessage(String processingMessage) CustomprocessingMessagefor this fileUploadItem's canvas.voidsetReplaceFilesOnDrop(Boolean replaceFilesOnDrop) setShowCancelButton(Boolean showCancelButton) setShowFileThumbnails(Boolean showFileThumbnails) setShowImagePreviews(Boolean showImagePreviews) setThumbnailHeight(Integer thumbnailHeight) setThumbnailWidth(Integer thumbnailWidth) voidMethods inherited from class com.smartgwt.client.widgets.form.fields.CanvasItem
addCanEditChangedHandler, addReadOnlyDisplayChangedHandler, addShowValueHandler, createCanvas, getApplyPromptToCanvas, getAutoDestroy, getEditCriteriaInInnerForm, getHeight, getHeightAsString, getMaxHeight, getMinHeight, getOverflow, getPrompt, getShouldSaveValue, hasAdvancedCriteria, isFocused, setApplyPromptToCanvas, setAutoDestroy, setCanEditCriterionPredicate, setCanvas, setCriterionGetter, setCriterionSetter, setDefaultProperties, setEditCriteriaInInnerForm, setHeight, setHeight, setMaxHeight, setMinHeight, setOverflow, setPrompt, setShouldDisableCanvasCustomizer, setShouldSaveValue, setupCanvasConstructor, storeValue, storeValue, storeValue, updateCanvasTabPositionMethods inherited from class com.smartgwt.client.widgets.form.fields.FormItem
_getValue, addBlurHandler, addChangedHandler, addChangeHandler, addClickHandler, addDoubleClickHandler, addEditorEnterHandler, addEditorExitHandler, addFocusHandler, addIcon, addIcon, addIconClickHandler, addIconKeyPressHandler, addItemHoverHandler, addKeyDownHandler, addKeyPressHandler, addKeyUpHandler, addPendingStatusChangedHandler, addPickerIconClickHandler, addShowContextMenuHandler, addTitleClickHandler, addTitleDoubleClickHandler, addTitleHoverHandler, addValueHoverHandler, addValueIconClickHandler, applyFormula, asSGWTComponent, blurItem, canEditCriterion, checkFormItemType, clearErrors, clearValue, disable, disableIcon, enable, enableIcon, error, error, errorIfNotCreated, focusAfterItem, focusInItem, getAccessKey, getAlign, getAllowExpressions, getAlwaysFetchMissingValues, getAlwaysShowControlBox, getApplyAlignToText, getApplyHeightToTextBox, getAriaRole, getAttribute, getAttributeAsBoolean, getAttributeAsBoolean, getAttributeAsDate, getAttributeAsDouble, getAttributeAsFloat, getAttributeAsInt, getAttributeAsJavaScriptObject, getAttributeAsObject, getAttributeAsString, getAutoComplete, getAutoCompleteKeywords, getBrowserInputType, getBrowserSpellCheck, getCanEdit, getCanEditOpaqueValues, getCanFocus, getCanHover, getCanSelectText, getCanTabToIcons, getCanvasAutoChild, getCellHeight, getCellStyle, getChangeOnKeypress, getClassName, getClipStaticValue, getClipTitle, getConfig, getContainerWidget, getControlStyle, getCriteriaField, getCriterion, getCriterion, getCursorPosition, getCustomState, getDataPath, getDateFormatter, getDecimalPad, getDecimalPrecision, getDefaultIconSrc, getDefaultOperator, getDefaultValue, getDeferActionConversion, getDestroyed, getDisabled, getDisabledHover, getDisableIconsOnReadOnly, getDisplayField, getDisplayFieldName, getDisplayValue, getDisplayValue, getEditorTypeConfig, getEditPendingCSSText, getEditProxyConstructor, getEmptyDisplayValue, getEmptyValueIcon, getEndRow, getErrorIconHeight, getErrorIconProperties, getErrorIconSrc, getErrorIconWidth, getErrorMessageWidth, getErrors, getEscapeHTML, getExportFormat, getExtraControlTableCSS, getExtraTextBoxCSS, getFetchMissingValues, getFieldName, getFilterLocally, getForeignDisplayField, getForm, getFormat, getFormItemAutoChild, getFormula, getFullDataPath, getGlobalTabIndex, getGridColNum, getGridRowNum, getHidden, getHint, getHintStyle, getHoverAlign, getHoverDelay, getHoverFocusKey, getHoverHeight, getHoverHeightAsString, getHoverOpacity, getHoverPersist, getHoverStyle, getHoverVAlign, getHoverWidth, getHoverWidthAsString, getIcon, getIconBaseStyle, getIconHeight, getIconHSpace, getIconPageRect, getIconPrompt, getIconRect, getIcons, getIconTabPosition, getIconVAlign, getIconWidth, getID, getImageURLPrefix, getImageURLSuffix, getImplicitSave, getImplicitSaveOnBlur, getInputFormat, getLeft, getLinearColSpan, getLinearColSpanAsString, getLinearEndRow, getLinearEndRowAsString, getLinearStartRow, getLinearStartRowAsString, getLinearWidth, getLinearWidthAsString, getListGrid, getLoadingDisplayValue, getLocateItemBy, getMinHintWidth, getMultipleValueSeparator, getName, getNullOriginalValueText, getOperator, getOptionCriteria, getOptionDataSource, getOptionDataSourceAsString, getOptionFilterContext, getOptionOperationId, getOptionTextMatchStyle, getOriginalValueMessage, getPageLeft, getPageRect, getPageTop, getPaletteDefaults, getPicker, getPickerIcon, getPickerIcon, getPickerIconHeight, getPickerIconName, getPickerIconPrompt, getPickerIconProperties, getPickerIconSrc, getPickerIconStyle, getPickerIconTabPosition, getPickerIconWidth, getPixelHeight, getPixelWidth, getPrintReadOnlyTextBoxStyle, getPrintTextBoxStyle, getPrintTitleStyle, getReadOnlyCanSelectText, getReadOnlyControlStyle, getReadOnlyDisplay, getReadOnlyHover, getReadOnlyTextBoxStyle, getReadOnlyWhen, getRect, getRedrawOnChange, getRejectInvalidValueOnChange, getRequired, getRequiredMessage, getRequiredRightTitlePrefix, getRequiredRightTitleSuffix, getRequiredTitlePrefix, getRequiredTitleSuffix, getRequiredWhen, getRightTitlePrefix, getRightTitleSuffix, getRowSpan, getSaveOnEnter, getScClassName, getSelectedRecord, getSelectOnClick, getSelectOnFocus, getShowClippedTitleOnHover, getShowClippedValueOnHover, getShowDeletions, getShowDisabled, getShowDisabledIconsOnFocus, getShowDisabledPickerIconOnFocus, getShowErrorIcon, getShowErrorIconInline, getShowErrorStyle, getShowErrorText, getShowFocused, getShowFocusedErrorState, getShowFocusedIcons, getShowFocusedPickerIcon, getShowHint, getShowIcons, getShowIconsOnFocus, getShowImageAsURL, getShowOldValueInHover, getShowOver, getShowOverIcons, getShowPending, getShowPickerIcon, getShowPickerIconOnFocus, getShowRTL, getShowTitle, getShowValueIconOnly, getStartRow, getStaticHeight, getStopOnError, getStoreDisplayValues, getSupportsCutPasteEvents, getSuppressValueIcon, getSynchronousValidation, getTabIndex, getTextAlign, getTextBoxStyle, getTextFormula, getTimeFormatter, getTitle, getTitleAlign, getTitleColSpan, getTitleOrientation, getTitlePrefix, getTitleStyle, getTitleSuffix, getTitleVAlign, getTooltip, getTop, getType, getUpdateControlOnOver, getUpdatePickerIconOnOver, getUpdateTextBoxOnOver, getUseAdvancedCriteria, getUseDisabledHintStyleForReadOnly, getUseLocalDisplayFieldValue, getValidateOnChange, getValidateOnExit, getValidOperators, getVAlign, getValue, getValueAsFloat, getValueAsInteger, getValueAsLong, getValueAsRecordList, getValueDeselectedCSSText, getValueField, getValueFieldName, getValueIconHeight, getValueIconLeftPadding, getValueIconRightPadding, getValueIconSize, getValueIconWidth, getValueMap, getValueMapAsArray, getVisible, getVisibleHeight, getVisibleTitleWidth, getVisibleWhen, getVisibleWidth, getWarnOnEditorTypeConversion, getWarnOnEditorTypeConversionDefault, getWidth, getWidthAsString, getWrapHintText, getWrapStaticValue, getWrapTitle, handleWarnOnEditorTypeConversion, hasErrors, hide, hideIcon, invalidateDisplayValueCache, isAssignableFrom, isConfigOnly, isCreated, isCutEvent, isDisabled, isDrawn, isInGrid, isPasteEvent, isVisible, linkToInstanceUponCreate, mapDisplayToValue, mapValueToDisplay, mapValueToDisplay, mapValueToDisplay, redraw, redraw, removeIcon, selectedRecordChanged, setAccessKey, setAlign, setAllowExpressions, setAlwaysFetchMissingValues, setAlwaysShowControlBox, setApplyAlignToText, setApplyHeightToTextBox, setAriaRole, setAriaState, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAttribute, setAutoChildConstructor, setAutoChildProperties, setAutoChildProperties, setAutoChildProperties, setAutoChildVisibility, setAutoComplete, setAutoCompleteKeywords, setBrowserInputType, setBrowserSpellCheck, setCanEdit, setCanEditOpaqueValues, setCanFocus, setCanHover, setCanSelectText, setCanTabToIcons, setCellHeight, setCellStyle, setChangeOnKeypress, setClipStaticValue, setClipTitle, setColSpan, setColSpan, setConfigOnly, setControlStyle, setCriteriaField, setCriterion, setCustomStateGetter, setDataPath, setDateFormatter, setDecimalPad, setDecimalPrecision, setDefaultIconSrc, setDefaultOperator, setDefaultProperties, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDefaultValue, setDeferActionConversion, setDisabled, setDisabledHover, setDisableIconsOnReadOnly, setDisplayField, setDisplayFormat, setDisplayFormat, setEditorProperties, setEditorType, setEditorType, setEditorType, setEditorValueFormatter, setEditorValueParser, setEditPendingCSSText, setEditProxyConstructor, setEmptyDisplayValue, setEmptyValueIcon, setEndRow, setErrorFormatter, setErrorIconHeight, setErrorIconProperties, setErrorIconSrc, setErrorIconWidth, setErrorMessageWidth, setErrorOrientation, setErrors, setErrors, setEscapeHTML, setExportFormat, setExtraControlTableCSS, setExtraTextBoxCSS, setFetchMissingValues, setFilterLocally, setForeignDisplayField, setFormat, setFormula, setGlobalTabIndex, setHidden, setHint, setHintStyle, setHoverAlign, setHoverDelay, setHoverFocusKey, setHoverHeight, setHoverHeight, setHoverOpacity, setHoverPersist, setHoverStyle, setHoverVAlign, setHoverWidth, setHoverWidth, setIconBaseStyle, setIconDisabled, setIconHeight, setIconHSpace, setIconPrompt, setIcons, setIconShowOnFocus, setIconVAlign, setIconWidth, setID, setImageURLPrefix, setImageURLSuffix, setImplicitSave, setImplicitSaveOnBlur, setInitHandler, setInputFormat, setInputTransformer, setItemHoverFormatter, setItemTitleHoverFormatter, setItemValueHoverFormatter, setJavaScriptObject, setLeft, setLinearColSpan, setLinearColSpan, setLinearEndRow, setLinearEndRow, setLinearStartRow, setLinearStartRow, setLinearWidth, setLinearWidth, setLoadingDisplayValue, setLocateItemBy, setMinHintWidth, setMultipleValueSeparator, setName, setNullOriginalValueText, setNullProperty, setOperator, setOptionCriteria, setOptionDataSource, setOptionDataSource, setOptionFilterContext, setOptionOperationId, setOptionTextMatchStyle, setOriginalValueMessage, setPickerIconHeight, setPickerIconName, setPickerIconPrompt, setPickerIconProperties, setPickerIconSrc, setPickerIconStyle, setPickerIconWidth, setPrintReadOnlyTextBoxStyle, setPrintTextBoxStyle, setPrintTitleStyle, setProperty, setProperty, setProperty, setProperty, setProperty, setReadOnlyCanSelectText, setReadOnlyControlStyle, setReadOnlyDisplay, setReadOnlyHover, setReadOnlyTextBoxStyle, setReadOnlyWhen, setRedrawOnChange, setRejectInvalidValueOnChange, setRequired, setRequiredMessage, setRequiredRightTitlePrefix, setRequiredRightTitleSuffix, setRequiredTitlePrefix, setRequiredTitleSuffix, setRequiredWhen, setRightTitlePrefix, setRightTitleSuffix, setRowSpan, setSaveOnEnter, setScClassName, setSelectOnClick, setSelectOnFocus, setShowClippedTitleOnHover, setShowClippedValueOnHover, setShowDeletions, setShowDisabled, setShowDisabledIconsOnFocus, setShowDisabledPickerIconOnFocus, setShowErrorIcon, setShowErrorIconInline, setShowErrorStyle, setShowErrorText, setShowFocused, setShowFocusedErrorState, setShowFocusedIcons, setShowFocusedPickerIcon, setShowHint, setShowIcons, setShowIconsOnFocus, setShowIfCondition, setShowImageAsURL, setShowOldValueInHover, setShowOver, setShowOverIcons, setShowPending, setShowPickerIcon, setShowPickerIconOnFocus, setShowRTL, setShowTitle, setShowValueIconOnly, setStartRow, setStateCustomizer, setStaticHeight, setStopOnError, setStoreDisplayValues, setSupportsCutPasteEvents, setSuppressValueIcon, setSynchronousValidation, setTabIndex, setTextAlign, setTextBoxStyle, setTextFormula, setTimeFormatter, setTitle, setTitleAlign, setTitleColSpan, setTitleHoverFormatter, setTitleOrientation, setTitlePrefix, setTitleStyle, setTitleSuffix, setTitleVAlign, setTooltip, setTop, setType, setUpdateControlOnOver, setUpdatePickerIconOnOver, setUpdateTextBoxOnOver, setUseAdvancedCriteria, setUseDisabledHintStyleForReadOnly, setUseLocalDisplayFieldValue, setUseObjectFactoryForTypeFallback, setValidateOnChange, setValidateOnExit, setValidators, setValidOperators, setVAlign, setValue, setValue, setValue, setValue, setValue, setValue, setValueByDisplayValue, setValueByDisplayValue, setValueDeselectedCSSText, setValueField, setValueFormatter, setValueHoverFormatter, setValueIconHeight, setValueIconLeftPadding, setValueIconMapper, setValueIconRightPadding, setValueIcons, setValueIconSize, setValueIconWidth, setValueMap, setValueMap, setVisible, setVisibleWhen, setWarnOnEditorTypeConversion, setWarnOnEditorTypeConversionDefault, setWidth, setWidth, setWrapHintText, setWrapStaticValue, setWrapTitle, shouldApplyHeightToTextBox, shouldFetchMissingValue, shouldSaveOnEnter, shouldStopKeyPressBubbling, show, showIcon, showPicker, stopHover, storeValue, updateState, validate, valueClippedMethods inherited from class com.smartgwt.client.data.Field
getCanExport, getExportTitle, getPrimaryKey, getSortByField, setCanExport, setExportTitle, setPrimaryKey, setSortByFieldMethods inherited from class com.smartgwt.client.core.RefDataClass
getRef, getRef, internalSetIDMethods inherited from class com.smartgwt.client.core.DataClass
applyFactoryProperties, doAddHandler, fireEvent, getAttributeAsDoubleArray, getAttributeAsElement, getAttributeAsIntArray, getAttributeAsLong, getAttributeAsMap, getAttributeAsObject, getAttributeAsRecord, getAttributeAsStringArray, getAttributes, getHandlerCount, isFactoryCreated, setAttribute, setAttribute, setAttribute, setAttributeAsJavaObject, setFactoryCreatedMethods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.google.gwt.event.shared.HasHandlers
fireEvent
-
Constructor Details
-
FileUploadItem
public FileUploadItem() -
FileUploadItem
-
FileUploadItem
-
FileUploadItem
-
-
Method Details
-
getOrCreateRef
-
changeAutoChildDefaults
Changes the defaults for Canvas AutoChildren namedautoChildName.- Parameters:
autoChildName- name of an AutoChild to customize the defaults for.defaults- Canvas defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties.- See Also:
-
changeAutoChildDefaults
Changes the defaults for FormItem AutoChildren namedautoChildName.- Parameters:
autoChildName- name of an AutoChild to customize the defaults for.defaults- FormItem defaults to apply. These defaults override any existing properties without destroying or wiping out non-overridden properties. For usage tips on this param, seeSGWTProperties.- See Also:
-
changePickerIconDefaults
-
setAcceptedFileTypes
- Parameters:
acceptedFileTypes- New acceptedFileTypes value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getAcceptedFileTypes
- Returns:
- Current acceptedFileTypes value. Default value is null
-
setCanAddFilesOnClick
- Parameters:
canAddFilesOnClick- New canAddFilesOnClick value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getCanAddFilesOnClick
- Returns:
- Current canAddFilesOnClick value. Default value is null
-
setCancelButtonTitle
CustomcancelButtonTitlefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
cancelButtonTitle- New cancelButtonTitle value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getCancelButtonTitle
CustomcancelButtonTitlefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current cancelButtonTitle value. Default value is null
-
getCanvas
TheFileDropZonecomponent that provides the drag-drop file selection UI.The FileDropZone is automatically created using the
canvasConstructorandcanvasDefaultsproperties. To customize the FileDropZone, either set properties directly on the FileUploadItem (which are passed through to the FileDropZone) or overridecanvasDefaults.Access the FileDropZone via
fileUploadItem.canvasafter the item is created.This component is an AutoChild named "canvas". For an overview of how to use and configure AutoChildren, see
Using AutoChildren.- Overrides:
getCanvasin classCanvasItem- Returns:
- Current canvas value. Default value is null
-
setCanvasConstructor
The class to use for theCanvasautoChild. Default is FileDropZone.- Parameters:
canvasConstructor- New canvasConstructor value. Default value is "FileDropZone"- Returns:
FileUploadIteminstance, for chaining setter calls
-
getCanvasConstructor
The class to use for theCanvasautoChild. Default is FileDropZone.- Returns:
- Current canvasConstructor value. Default value is "FileDropZone"
-
setCanvasDefaults
Default properties for theCanvasautoChild FileDropZone.The default implementation includes handlers that forward
FileDropZone.filesAdded()andFileDropZone.filesRemoved()notifications to update the FormItem's value.When overriding, use
isc.addProperties()to merge with the defaults rather than replacing them entirely, to preserve the value synchronization behavior.- Parameters:
canvasDefaults- New canvasDefaults value. Default value is {...}- Returns:
FileUploadIteminstance, for chaining setter calls
-
getCanvasDefaults
Default properties for theCanvasautoChild FileDropZone.The default implementation includes handlers that forward
FileDropZone.filesAdded()andFileDropZone.filesRemoved()notifications to update the FormItem's value.When overriding, use
isc.addProperties()to merge with the defaults rather than replacing them entirely, to preserve the value synchronization behavior.- Returns:
- Current canvasDefaults value. Default value is {...}
-
setClickToAddMessage
CustomclickToAddMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
clickToAddMessage- New clickToAddMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getClickToAddMessage
CustomclickToAddMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current clickToAddMessage value. Default value is null
-
setDataSource
DataSource where files are stored whenmultiple:true.This DataSource should contain:
- A
primaryKeyfield - A field with a
foreignKeyrelationship to the primary key of the form's DataSource - A field of type "binary" for storing the uploaded file
This follows the same pattern as
MultiFileItem.dataSource. SeeMultiFileItemfor a complete example of the required DataSource structure.This property is required when
multiple:trueis set. If omitted, a warning will be logged and the item will behave as single-file upload.- Parameters:
dataSource- New dataSource value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
- A
-
getDataSource
DataSource where files are stored whenmultiple:true.This DataSource should contain:
- A
primaryKeyfield - A field with a
foreignKeyrelationship to the primary key of the form's DataSource - A field of type "binary" for storing the uploaded file
This follows the same pattern as
MultiFileItem.dataSource. SeeMultiFileItemfor a complete example of the required DataSource structure.This property is required when
multiple:trueis set. If omitted, a warning will be logged and the item will behave as single-file upload.- Returns:
- Returns the DataSource configured for storing uploaded files when
multiple:true. Default value is null
- A
-
setDataSource
DataSource where files are stored whenmultiple:true.This DataSource should contain:
- A
primaryKeyfield - A field with a
foreignKeyrelationship to the primary key of the form's DataSource - A field of type "binary" for storing the uploaded file
This follows the same pattern as
MultiFileItem.dataSource. SeeMultiFileItemfor a complete example of the required DataSource structure.This property is required when
multiple:trueis set. If omitted, a warning will be logged and the item will behave as single-file upload.- Parameters:
dataSource- New dataSource value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
- A
-
getDataSourceAsString
DataSource where files are stored whenmultiple:true.This DataSource should contain:
- A
primaryKeyfield - A field with a
foreignKeyrelationship to the primary key of the form's DataSource - A field of type "binary" for storing the uploaded file
This follows the same pattern as
MultiFileItem.dataSource. SeeMultiFileItemfor a complete example of the required DataSource structure.This property is required when
multiple:trueis set. If omitted, a warning will be logged and the item will behave as single-file upload.- Returns:
- Returns the DataSource configured for storing uploaded files when
multiple:true. Default value is null
- A
-
setDuplicateFileNameMessage
CustomduplicateFileNameMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
duplicateFileNameMessage- New duplicateFileNameMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getDuplicateFileNameMessage
CustomduplicateFileNameMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current duplicateFileNameMessage value. Default value is null
-
setEmptyDropAreaMessage
CustomemptyDropAreaMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
emptyDropAreaMessage- New emptyDropAreaMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getEmptyDropAreaMessage
CustomemptyDropAreaMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current emptyDropAreaMessage value. Default value is null
-
setInvalidFileTypeMessage
CustominvalidFileTypeMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
invalidFileTypeMessage- New invalidFileTypeMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getInvalidFileTypeMessage
CustominvalidFileTypeMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current invalidFileTypeMessage value. Default value is null
-
setMaxFiles
- Parameters:
maxFiles- New maxFiles value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getMaxFiles
- Returns:
- Current maxFiles value. Default value is null
-
setMaxFilesErrorMessage
CustommaxFilesErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
maxFilesErrorMessage- New maxFilesErrorMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getMaxFilesErrorMessage
CustommaxFilesErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current maxFilesErrorMessage value. Default value is null
-
setMaxFileSize
- Parameters:
maxFileSize- New maxFileSize value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getMaxFileSize
- Returns:
- Current maxFileSize value. Default value is null
-
setMaxFileSizeErrorMessage
CustommaxFileSizeErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
maxFileSizeErrorMessage- New maxFileSizeErrorMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getMaxFileSizeErrorMessage
CustommaxFileSizeErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current maxFileSizeErrorMessage value. Default value is null
-
setMaxSize
SeeFileDropZone.maxSize.- Parameters:
maxSize- New maxSize value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getMaxSize
SeeFileDropZone.maxSize.- Returns:
- Current maxSize value. Default value is null
-
setMaxSizeErrorMessage
CustommaxSizeErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
maxSizeErrorMessage- New maxSizeErrorMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getMaxSizeErrorMessage
CustommaxSizeErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current maxSizeErrorMessage value. Default value is null
-
setMinSize
SeeFileDropZone.minSize.- Parameters:
minSize- New minSize value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getMinSize
SeeFileDropZone.minSize.- Returns:
- Current minSize value. Default value is null
-
setMinSizeErrorMessage
CustomminSizeErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
minSizeErrorMessage- New minSizeErrorMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getMinSizeErrorMessage
CustomminSizeErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current minSizeErrorMessage value. Default value is null
-
setMultiple
Whether this FileUploadItem allows multiple files to be selected.When
multiple:true, aDataSourceproperty must also be specified pointing to a related DataSource that will store the uploaded files, following the same master-detail pattern asMultiFileItem. Each file will be uploaded as a separate record in the detail DataSource after the master record is saved.If
multiple:trueis set without a validDataSource, a warning will be logged and the item will behave as ifmultiple:false.See
FileDropZone.multiplefor the underlying FileDropZone property.- Overrides:
setMultiplein classCanvasItem- Parameters:
multiple- New multiple value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls- See Also:
-
getMultiple
Whether this FileUploadItem allows multiple files to be selected.When
multiple:true, aDataSourceproperty must also be specified pointing to a related DataSource that will store the uploaded files, following the same master-detail pattern asMultiFileItem. Each file will be uploaded as a separate record in the detail DataSource after the master record is saved.If
multiple:trueis set without a validDataSource, a warning will be logged and the item will behave as ifmultiple:false.See
FileDropZone.multiplefor the underlying FileDropZone property.- Overrides:
getMultiplein classCanvasItem- Returns:
- Current multiple value. Default value is null
- See Also:
-
setMultipleFilesErrorMessage
CustommultipleFilesErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
multipleFilesErrorMessage- New multipleFilesErrorMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getMultipleFilesErrorMessage
CustommultipleFilesErrorMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current multipleFilesErrorMessage value. Default value is null
-
setProcessingMessage
CustomprocessingMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Parameters:
processingMessage- New processingMessage value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getProcessingMessage
CustomprocessingMessagefor this fileUploadItem's canvas. If unset, the default property will be used.- Returns:
- Current processingMessage value. Default value is null
-
setReplaceFilesOnDrop
- Parameters:
replaceFilesOnDrop- New replaceFilesOnDrop value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getReplaceFilesOnDrop
- Returns:
- Current replaceFilesOnDrop value. Default value is null
-
setShowCancelButton
- Parameters:
showCancelButton- New showCancelButton value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getShowCancelButton
- Returns:
- Current showCancelButton value. Default value is null
-
setShowFileThumbnails
- Parameters:
showFileThumbnails- New showFileThumbnails value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getShowFileThumbnails
- Returns:
- Current showFileThumbnails value. Default value is null
-
setShowImagePreviews
- Parameters:
showImagePreviews- New showImagePreviews value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getShowImagePreviews
- Returns:
- Current showImagePreviews value. Default value is null
-
setThumbnailHeight
- Parameters:
thumbnailHeight- New thumbnailHeight value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getThumbnailHeight
- Returns:
- Current thumbnailHeight value. Default value is null
-
setThumbnailWidth
- Parameters:
thumbnailWidth- New thumbnailWidth value. Default value is null- Returns:
FileUploadIteminstance, for chaining setter calls
-
getThumbnailWidth
- Returns:
- Current thumbnailWidth value. Default value is null
-
cancelProcessing
public void cancelProcessing() -
endProcessing
public void endProcessing() -
getFiles
public void getFiles() -
getSize
public void getSize() -
setFileProgress
public void setFileProgress() -
setProcessingProgress
public void setProcessingProgress() -
startProcessing
public void startProcessing() -
setDefaultProperties
Class level method to set the default properties of this class. If set, then all existing and subsequently created instances of this class will automatically have default properties corresponding to the properties of the class instance passed to this function. This is a powerful feature that eliminates the need for users to create a separate hierarchy of subclasses that only alter the default properties of this class. Can also be used for skinning / styling purposes.Note: This method is intended for setting default attributes only and will affect all instances of the underlying class (including those automatically generated in JavaScript). This method should not be used to apply standard EventHandlers or override methods for a class - use a custom subclass instead. Calling this method after instances have been created can result in undefined behavior, since it bypasses any setters and a class instance may have already examined a particular property and not be expecting any changes through this route.
- Parameters:
fileUploadItemProperties- properties that should be used as new defaults when instances of this class are created- See Also:
-