Properties Methods Events Config Options Direct Link
Observable
  Component
    BoxComponent
      Container
        Panel
          CompositeField
            SmartFile

Class CQ.html5.form.SmartFile

Package:CQ.html5.form
Class:SmartFile
Subclasses:SmartImage
Extends:CQ.form.CompositeField
Clientlib:cq.widgets
xtype:html5smartfile

The SmartFile is an intelligent file uploader.

If the browser supports HTML5, uploads are executed using the HTML5 that provides a convenient way to handle uploads. If the browser does not support such way of upload or if it is disabled by the corresponding config option, a HTML fallback is used instead, which imposes some restrictions compared with the HTML5 version.

Component linking may be used to validate form fields that depend on the content of a SmartFile instance. Just add the name of the dependant SmartFile instance as a linkedComponent property (type: String) to the corresponding field(s). The SmartFile component will then call the CQ.Ext.form.TextField.validate method of the linked form field to trigger the validation. There is also a SmartFile-specific VType available: use "requiredOnLinkedData" for fields that are required only if the linked SmartFile component has a file uploaded or referenced.


Added in CQ 5.5, replaces CQ.form.SmartFile.

Config Options

Config Options Defined By
  allowBlank : Boolean
False to validate that the value length > 0 (defaults to true)
CompositeField
  allowDomMove : Boolean
Whether the component can move the Dom node when rendering (defaults to true).
Component
  allowFileNameEditing : Boolean
True if the name of an uploaded file is editable (defaults to true)
SmartFile
  allowFileReference : Boolean
Flag if referencing a file is allowed (defaults to true)
SmartFile
  allowUpload : Boolean
Flag if uploading a file is allowed (defaults to true)
SmartFile
  blankText : String
Error text to display if the allow blank validation fails (defaults to "This field is required")
CompositeField
  ddAccept : String
MIME type definition of files that are allowed for referencing using drag & drop (defaults to "*")
SmartFile
  ddGroups : String[]
Groups involved in drag & drop (no default specified)
SmartFile
  disabled : Boolean
Render this component disabled (default is false).
Component
  disabledClass : String
CSS class added to the component when it is disabled (defaults to 'x-item-disabled').
Component
  footPanel : CQ.Ext.Panel
A panel that is added below the SmartFile's working area (defaults to null)
SmartFile
  headPanel : CQ.Ext.Panel
A panel that is added above the SmartFile's working area (defaults to null)
SmartFile
  ignoreData : Boolean
True to ignore data from records (defaults to false)
CompositeField
  invalidClass : String
CSS class to be used to mark the smart image component as invalid (defaults to "cq-smartfile-invalid")
SmartFile
  lockHintCls : String
CSS class to be used for the lock panel (defaults to "cq-lock-hint")
SmartFile
  lockIconCls : String
CSS class to use for displaying the lock icon (defaults to "cq-lock-placeholder")
SmartFile
  lockPanelCls : String
CSS class to be used for the lock panel (defaults to "cq-lock-panel")
SmartFile
  mimeTypesDescription : String
A String that describes the allowed MIME types (defaults to "All files")
SmartFile
  name : String
The field's HTML name attribute (defaults to "").
CompositeField
  noFileNameText : String
Text to display if no file name is given (defaults to "???") Added in CQ 5.4.
SmartFile
  pageX : Number
The page level x coordinate for this component if contained within a positioning container.
BoxComponent
  pageY : Number
The page level y coordinate for this component if contained within a positioning container.
BoxComponent
  readOnly : Boolean
True to mark the field as readOnly in HTML (defaults to false)
CompositeField
  removeUploadPanelClsOnProgress : Boolean
True if the CSS class of the upload panel should be removed when the upload progress is displayed (defaults to true)
SmartFile
  sizeLimit : Number
Maximum size of a file to be uploaded in Megabytes; defaults to 0 (unlimited)
SmartFile
  transferFileName : Boolean
True if the filename has to be submitted as a separate form field (defaults to true)
SmartFile
  uploadHintCls : String
CSS class to be used for the upload hint (defaults to "cq-upload-hint")
SmartFile
  uploadIconCls : String
CSS class to use for displaying the upload icon (defaults to "cq-file-placeholder")
SmartFile
  uploadPanelCls : String
CSS class to be used for the upload panel (defaults to "cq-upload-border")
SmartFile
  uploadTextFallback : String
Text used in the upload panel if HTML5 is unavailable (defaults to "Upload file")
SmartFile
  uploadTextReference : String
Text used in the upload panel if referencing is allowed only (defauls to "Drop an asset")
SmartFile
  uploadTextUpload : String
Text used in the upload panel if uploading is allowed only (defaults to "Click to upload")
SmartFile
  useHTML5 : Boolean
True to use HTML5 upload (if supported by the browser) Defaults to true.
SmartFile
  validateOnSubmitOnly : Boolean
True if the component should be validated on submit only - and not on each state change (defaults to false)
SmartFile
  value : Mixed
A value to initialize this field with (defaults to undefined).
CompositeField
  x : Number
The local x (left) coordinate for this component if contained within a positioning container.
BoxComponent
  y : Number
The local y (top) coordinate for this component if contained within a positioning container.
BoxComponent

Public Properties

Property Defined By
  buttons : Array
This Panel's Array of buttons as created from the buttons config property. Read only.
Panel
  bwrap : CQ.Ext.Element
The Panel's bwrap Element used to contain other Panel elements (tbar, body, bbar, footer). See bodyCfg. Read-only.
Panel
  collapsed : Boolean
True if this panel is collapsed. Read-only.
Panel
  disabled : Boolean
True if this component is disabled. Read-only.
Component
  header : CQ.Ext.Element
The Panel's header Element. Read-only.

This Element is used to house the title and tools


Note: see the Note for el also.

Panel
  hidden : Boolean
True if this component is hidden. Read-only.
Component
  initialConfig : Object
This Component's initial configuration specification. Read-only.
Component
  items : MixedCollection
The collection of components in this container as a CQ.Ext.util.MixedCollection
Container
  refOwner : CQ.Ext.Container The
Component
  rendered : Boolean
True if this component has been rendered. Read-only.
Component

Public Methods

Method Defined By

Public Events

Event Defined By