dojox/form/FileUploader (version 1.10)

dijit/_Widget, dijit/_TemplatedMixin, dijit/_Contained

Summary

Handles File Uploading to a server (PHP script included for testing)

FileUploader is now a WIDGET. You do not have to pass a button in. Passing a button is still supported until version 1.5 to maintain backwards compatibility, but it is not recommended. Just create your uploader like any other widget.

If the correct version of Flash Player is available (> 9.0) , a SWF is used. If Flash Player is not installed or is outdated, a typical html fileInput is used. This process can be overridden with force:"flash" or force:"html".

FileUploader works with Flash 10.

The button styles are now recreated in Flash, so there is no longer using an invisible Flash movie with wmode=transparent. This way the Flash button is actually placed inline with the DOM, not floating above it and constantly resetting its position. The "Windows Firefox clickable bug" should be fixed (and hopefully some Linux problems).

The HTML button is created in a new way and it is now inline as is the FLash button. Styling is much easier and more versatile.

Dependencies

FileUploader no longer uses FileInput.css. It now uses FileUploader.css See requires for JavaScript dependencies.

NEW FEATURES

There are a ton of features and fixes in this version:

CDN USERS

FileUpload now works with the CDN but with limitations. The SWF must be from the same domain as the HTML page. 'swfPath' has been exposed so that you may link to that file (could of course be the same SWF in dojox resource folder). The SWF will NOT work from the CDN server. This would require a special XML file that would allow access to your server, and the logistics to that is impossible.

LIMITATIONS

OPERA USERS

It works better than the 1.3 version. fileInputs apperantly can't have opacity set to zero. The Flash uploader works but files are auto-uploaded. Must be a flashVar problem.

Safari Bug note:

The bug is in the way Safari handles the connection: https://bugs.webkit.org/show_bug.cgi?id=5760 I added this to the virtual host in the Apache conf file, and now it works like a charm:

BrowserMatch Safari nokeepalive

Usage

var foo = new FileUploader();
dojox/form/FileUploader

See the dojox/form/FileUploader reference documentation for more information.

Property Summary

  • _attachEventsList of connections associated with data-dojo-attach-event=... in the template
  • _attachPointsList of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]
  • _attrPairNames
  • _blankGifPath to a blank 1x1 image.
  • _focusManager
  • _renderedNot normally use, but this flag can be set by the app if the server has already rendered the template, i.e. already inlining the template for the widget into the main page.
  • _setClassAttr
  • _setDirAttr
  • _setIdAttr
  • _setLangAttr
  • _setTypeAttr
  • _skipNodeCache
  • _startedstartup() has completed.
  • activeClassThe name of the class that will style the button in a "press" state.
  • attachScopeObject to which attach points and events will be scoped.
  • attributeMapDeprecated.
  • baseClassThe name of the class that will style the button in a "normal" state.
  • class
  • containerNodeDesignates where children of the source DOM node will be placed. "Children" in this case refers to both DOM nodes and widgets.
  • deferredUploading(Flash only) throttles the upload to a certain amount of files at a time.
  • devModeRe-implemented. devMode increases the logging, adding style tracing from the SWF.
  • dirBi-directional support, as defined by the HTML DIR attribute.
  • disabledClassThe name of the class that will style the button when its disabled.
  • domNodeThis is our visible representation of the widget!
  • fileListIdThe id of a dom node to be used as a container for the pending file list.
  • fileMask(an array, or an array of arrays) Restrict file selection to certain file types Empty array defaults to "All Files" example: fileMask = ["Images", "*.jpg;*.jpeg;*.gif;*.png"] or fileMask = [ ["Jpeg File", "*.jpg;*.jpeg"], ["GIF File", "*.gif"], ["PNG File", "*.png"], ["All Images", "*.jpg;*.jpeg;*.gif;*.png"], ] NOTE: MacType is not supported, as it does not work very well. fileMask will work on a Mac, but differently than Windows.
  • flashFieldNameThe name of the field of the flash uploaded files that the server is expecting
  • flashMovieThe SWF.
  • flashObjectThe object that creates the SWF embed object.
  • focusedThis widget or a widget it contains has focus, or is "active" because it was recently clicked.
  • forceUse "flash" to always use Flash (and hopefully force the user to download the plugin if they don't have it).
  • hoverClassThe name of the class that will style the button in a "hover" state.
  • htmlFieldNameThe name of the field of the fileInput that the server is expecting
  • idThe object id, just like any other widget in Dojo.
  • insideNodeThe div that holds the SWF and form/fileInput
  • isDebugIf true, outputs traces from the SWF to console.
  • langRarely used.
  • minFlashVersionThe minimum of version of Flash player to target. 0 would always install Flash, 100 would never install it.
  • ownerDocumentThe document this widget belongs to.
  • progressBackgroundColorThe background color to use for the button-progress
  • progressBackgroundUrlThe background image to use for the button-progress
  • progressMessageThe message shown while the button is changed to a progress bar
  • progressWidgetIdThe widget id of a Dijit Progress bar.
  • searchContainerNode
  • selectMultipleFilesIf true and flash mode, multiple files may be selected from the dialog.
  • serverTimeoutThe amount of time given to the uploaded file to wait for a server response.
  • showProgressIf true, the button changes to a progress bar during upload.
  • skipServerCheckIf true, will not verify that the server was sent the correct format.
  • srcNodeRefpointer to original DOM node
  • styleHTML style attributes as cssText string or name/value hash
  • swfPath
  • tabIndexThe tab order in the DOM.
  • templatePathPath to template (HTML file) for this widget relative to dojo.baseUrl.
  • templateString
  • titleHTML title attribute.
  • tooltipWhen this widget's title attribute is used to for a tab label, accordion pane title, etc., this specifies the tooltip to appear when the mouse is hovered over that text.
  • uploaderTypeInternal.
  • uploadOnChangeIf true, uploads immediately after a file has been selected.
  • uploadUrlThe url targeted for upload.
  • version1.5 (deprecated)

Method Summary

  • _addToFileList() Internal only.
  • _animateProgress() Internal.
  • _applyAttributes() Step during widget creation to copy widget attributes to the DOM according to attributeMap and _setXXXAttr objects, and also to call custom _setXXXAttr() methods.
  • _attach(node,type,func) Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event.
  • _attachTemplateNodes(rootNode) Iterate through the dom nodes and attach functions and nodes accordingly.
  • _attrToDom(attr,value,commands) Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified by commands parameter.
  • _beforeFillContent()
  • _buildFileInput() Build the fileInput field
  • _buildForm() Build the form that holds the fileInput
  • _change(dataArray) Internal.
  • _changeAttrValue(name,value) Internal helper for directly changing an attribute value.
  • _checkHtmlCancel(mouseType) Internal.
  • _complete(dataArray) Internal.
  • _connectFlash() Subscribing to published topics coming from the Flash uploader.
  • _connectInput() Internal.
  • _detachTemplateNodes() Detach and clean up the attachments made in _attachtempalteNodes.
  • _disconnect() Internal.
  • _displayProgress(display) Shows and updates the built-in progress bar.
  • _doSub(subStr,funcStr) Internal.
  • _error(evt)
  • _escapeValue(val) Escape a value to be inserted into the template, either into an attribute value (ex: foo="${bar}") or as inner text of an element (ex: ${foo})
  • _fillContent(source) Relocate source contents to templated container node. this.containerNode must be able to receive children, or exceptions will be thrown.
  • _get(name) Helper function to get value for specified property stored by this._set(), i.e. for properties with custom setters.
  • _getAttrNames(name) Helper function for get() and set().
  • _getDisabledAttr() Internal.
  • _getSibling(which) Returns next or previous sibling
  • _introspect() Collect metadata about this widget (only once per class, not once per instance): - list of attributes with custom setters, storing in this.constructor._setterAttrs - generate this.constructor._onMap, mapping names like "mousedown" to functions like onMouseDown
  • _processTemplateNode(baseNode,getAttrFunc,attachFunc) Process data-dojo-attach-point and data-dojo-attach-event for given node or widget.
  • _progress(dataObject) Internal.
  • _renumberInputs()
  • _resetHTML() Internal.
  • _set(name,value) Helper function to set new value for specified property, and call handlers registered with watch() if the value has changed.
  • _setDisabledAttr(disabled) Internal.
  • _setFocusedAttr(val)
  • _setFormStyle() Apply a dynamic style to the form and input
  • _setHtmlPostData() Internal.Apply postData to hidden fields in form
  • _setOwnerDocumentAttr(val)
  • _setStyleAttr(value) Sets the style attribute of the widget according to value, which is either a hash like {height: "5px", width: "3px"} or a plain string
  • _stringRepl(tmpl) Does substitution of ${foo} type properties in template string
  • _styleContent() Internal.Apply style to node
  • attr(name,value) This method is deprecated, use get() or set() directly.
  • buildRendering() Construct the UI for this widget, setting this.domNode.
  • connect(obj,event,method) Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.
  • create(params,srcNodeRef) Kick off the life-cycle of a widget
  • createFlashUploader() Internal.
  • createHtmlUploader() Internal.
  • defer(fcn,delay) Wrapper to setTimeout to avoid deferred functions executing after the originating widget has been destroyed.
  • destroy() Destroys uploader button
  • destroyDescendants(preserveDom) Recursively destroy the children of this widget and their descendants.
  • destroyRecursive(preserveDom) Destroy this widget and its descendants
  • destroyRendering(preserveDom) Destroys the DOM nodes associated with this widget.
  • disconnect(handle) Deprecated, will be removed in 2.0, use handle.remove() instead.
  • emit(type,eventObj,callbackArgs) Used by widgets to signal that a synthetic event occurred, ex: myWidget.emit("attrmodified-selectedChildWidget", {}).
  • get(name) Get a property from a widget.
  • getButtonStyle() Internal.
  • getChildren() Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent is this widget.
  • getDescendants() Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode.
  • getHiddenNode(node) Internal.
  • getIndexInParent() Returns the index of this widget within its container parent.
  • getNextSibling() Returns null if this is the last child of the parent, otherwise returns the next element sibling to the "right".
  • getParent() Returns the parent widget of this widget.
  • getPreviousSibling() Returns null if this is the first child of the parent, otherwise returns the next element sibling to the "left".
  • getStyle(node)
  • getTempNodeStyle(node,_class,isDijitButton)
  • getText(node)
  • getTextStyle(node)
  • isButton(node)
  • isFocusable() Return true if this widget can currently be focused and false if not
  • isLeftToRight() Return this widget's explicit or implicit orientation (true for LTR, false for RTL)
  • log() Due to the excessive logging necessary to make this code happen, It's easier to turn it on and off here in one place.
  • on(type,func)
  • own() Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.
  • placeAt(reference,position) Place this widget somewhere in the DOM based on standard domConstruct.place() conventions.
  • postCreate()
  • postMixInProperties()
  • postscript(params,srcNodeRef) Kicks off widget instantiation.
  • removeFile(name,noListEdit) Removes a file from the pending file list.
  • set(name,value) Set a property on a widget
  • setAttribute(attr,value) Deprecated.
  • setButtonStyle() Internal.
  • startup()
  • submit(form) If FileUploader is in a form, and other data should be sent along with the files, use this instead of form submit.
  • subscribe(t,method) Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.
  • toString() Returns a string that represents the widget.
  • uninitialize() Deprecated.
  • unsubscribe(handle) Deprecated, will be removed in 2.0, use handle.remove() instead.
  • upload(data) When called, begins file upload
  • uploadFlash() Internal.
  • uploadHTML() Internal.
  • urlencode(url)
  • watch(name,callback) Watches a property for changes

Event Summary

  • _onBlur() This is where widgets do processing for when they stop being active, such as changing CSS classes.
  • _onFlashBlur() Internal.
  • _onFocus() This is where widgets do processing for when they are active, such as changing CSS classes.
  • _onMap(type) Maps on() type parameter (ex: "mousemove") to method name (ex: "onMouseMove").
  • _onShow() Internal method called when this widget is made visible.
  • onBlur() Called when the widget stops being "active" because focus moved to something outside of it, or the user clicked somewhere outside of it, or the widget was hidden.
  • onCancel() Stub to connect Fires when dialog box has been closed without a file selection
  • onChange(dataArray) stub to connect Fires when files are selected Event is an array of last files selected
  • onClick(event) Connect to this function to receive notifications of mouse click events.
  • onClose() Called when this widget is being displayed as a popup (ex: a Calendar popped up from a DateTextBox), and it is hidden.
  • onComplete(dataArray) stub to connect Fires when all files have uploaded Event is an array of all files
  • onDblClick(event) Connect to this function to receive notifications of mouse double click events.
  • onError(evtObject) Fires on errors
  • onFocus() Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.
  • onHide() Called when another widget becomes the selected pane in a dijit/layout/TabContainer, dijit/layout/StackContainer, dijit/layout/AccordionContainer, etc.
  • onKeyDown(event) Connect to this function to receive notifications of keys being pressed down.
  • onKeyPress(event) Connect to this function to receive notifications of printable keys being typed.
  • onKeyUp(event) Connect to this function to receive notifications of keys being released.
  • onLoad(uploader) Stub - SWF has been downloaded 100%.
  • onMouseDown(event) Connect to this function to receive notifications of when the mouse button is pressed down.
  • onMouseEnter(event) Connect to this function to receive notifications of when the mouse moves onto this widget.
  • onMouseLeave(event) Connect to this function to receive notifications of when the mouse moves off of this widget.
  • onMouseMove(event) Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.
  • onMouseOut(event) Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.
  • onMouseOver(event) Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.
  • onMouseUp(event) Connect to this function to receive notifications of when the mouse button is released.
  • onProgress(dataArray) Stub to connect Fires as progress returns from SWF Event is an array of all files uploading Can be connected to for HTML uploader, but will not return anything.
  • onReady(uploader) Stub - Fired when embedFlash has created the Flash object, but it has not necessarilly finished downloading, and is ready to be communicated with.
  • onShow() Called when this widget becomes the selected pane in a dijit/layout/TabContainer, dijit/layout/StackContainer, dijit/layout/AccordionContainer, etc.

Properties

_attachEvents
Defined by: dijit/_AttachMixin

List of connections associated with data-dojo-attach-event=... in the template

_attachPoints
Defined by: dijit/_AttachMixin

List of widget attribute names associated with data-dojo-attach-point=... in the template, ex: ["containerNode", "labelNode"]

_attrPairNames
Defined by: dijit/_WidgetBase
_blankGif
Defined by: dijit/_WidgetBase

Path to a blank 1x1 image. Used by <img> nodes in templates that really get their image via CSS background-image.

_focusManager
Defined by: dijit/_FocusMixin
_rendered
Defined by: dijit/_TemplatedMixin

Not normally use, but this flag can be set by the app if the server has already rendered the template, i.e. already inlining the template for the widget into the main page. Reduces _TemplatedMixin to just function like _AttachMixin.

_setClassAttr
Defined by: dijit/_WidgetBase
_setDirAttr
Defined by: dijit/_WidgetBase
_setIdAttr
Defined by: dijit/_WidgetBase
_setLangAttr
Defined by: dijit/_WidgetBase
_setTypeAttr
Defined by: dijit/_WidgetBase
_skipNodeCache
Defined by: dijit/_TemplatedMixin
_started
Defined by: dijit/_WidgetBase

startup() has completed.

activeClass

The name of the class that will style the button in a "press" state. A specific class should be made to do this. Do not rely on a target like button:active{...}

attachScope
Defined by: dijit/_AttachMixin

Object to which attach points and events will be scoped. Defaults to 'this'.

attributeMap
Defined by: dijit/_WidgetBase

Deprecated. Instead of attributeMap, widget should have a _setXXXAttr attribute for each XXX attribute to be mapped to the DOM.

attributeMap sets up a "binding" between attributes (aka properties) of the widget and the widget's DOM. Changes to widget attributes listed in attributeMap will be reflected into the DOM.

For example, calling set('title', 'hello') on a TitlePane will automatically cause the TitlePane's DOM to update with the new title.

attributeMap is a hash where the key is an attribute of the widget, and the value reflects a binding to a:

  • DOM node attribute

    focus: {node: "focusNode", type: "attribute"} Maps this.focus to this.focusNode.focus

  • DOM node innerHTML

    title: { node: "titleNode", type: "innerHTML" } Maps this.title to this.titleNode.innerHTML

  • DOM node innerText

    title: { node: "titleNode", type: "innerText" } Maps this.title to this.titleNode.innerText

  • DOM node CSS class

    myClass: { node: "domNode", type: "class" } Maps this.myClass to this.domNode.className

If the value is an array, then each element in the array matches one of the formats of the above list.

There are also some shorthands for backwards compatibility:

  • string --> { node: string, type: "attribute" }, for example:
"focusNode" ---> { node: "focusNode", type: "attribute" }
  • "" --> { node: "domNode", type: "attribute" }
baseClass

The name of the class that will style the button in a "normal" state. If baseClass is not defined, 'class' will be used. NOTE: By default the uploader will be styled like a dijit buttons and adhere to the the themes. Tundra, Soria, and Nihilo are supported. You can cascade the existing style by using 'class' or 'style'. If you overwrite baseClass, you should overwrite the remaing state classes that follow) as well.

class
Defined by: dijit/_WidgetBase
containerNode
Defined by: dijit/_WidgetBase

Designates where children of the source DOM node will be placed. "Children" in this case refers to both DOM nodes and widgets. For example, for myWidget:

<div data-dojo-type=myWidget>
    <b> here's a plain DOM node
    <span data-dojo-type=subWidget>and a widget</span>
    <i> and another plain DOM node </i>
</div>

containerNode would point to:

<b> here's a plain DOM node
<span data-dojo-type=subWidget>and a widget</span>
<i> and another plain DOM node </i>

In templated widgets, "containerNode" is set via a data-dojo-attach-point assignment.

containerNode must be defined for any widget that accepts innerHTML (like ContentPane or BorderContainer or even Button), and conversely is null for widgets that don't, like TextBox.

deferredUploading

(Flash only) throttles the upload to a certain amount of files at a time. By default, Flash uploads file one at a time to the server, but in parallel. Firefox will try to queue all files at once, leading to problems. Set this to the amount to upload in parallel at a time. Generally, 1 should work fine, but you can experiment with queuing more than one at a time. This is of course ignored if selectMultipleFiles equals false.

devMode

Re-implemented. devMode increases the logging, adding style tracing from the SWF.

dir
Defined by: dijit/_WidgetBase

Bi-directional support, as defined by the HTML DIR attribute. Either left-to-right "ltr" or right-to-left "rtl". If undefined, widgets renders in page's default direction.

disabledClass

The name of the class that will style the button when its disabled.

domNode
Defined by: dijit/_WidgetBase

This is our visible representation of the widget! Other DOM Nodes may by assigned to other properties, usually through the template system's data-dojo-attach-point syntax, but the domNode property is the canonical "top level" node in widget UI.

fileListId

The id of a dom node to be used as a container for the pending file list.

fileMask

(an array, or an array of arrays) Restrict file selection to certain file types Empty array defaults to "All Files"

example:

fileMask = ["Images", "*.jpg;*.jpeg;*.gif;*.png"]

or

fileMask = [
    ["Jpeg File",   "*.jpg;*.jpeg"],
    ["GIF File",    "*.gif"],
    ["PNG File",    "*.png"],
    ["All Images",  "*.jpg;*.jpeg;*.gif;*.png"],
]

NOTE: MacType is not supported, as it does not work very well. fileMask will work on a Mac, but differently than Windows.

flashFieldName

The name of the field of the flash uploaded files that the server is expecting

flashMovie

The SWF. Mostly Internal.

flashObject

The object that creates the SWF embed object. Mostly Internal.

focused
Defined by: dijit/_FocusMixin

This widget or a widget it contains has focus, or is "active" because it was recently clicked.

force

Use "flash" to always use Flash (and hopefully force the user to download the plugin if they don't have it). Use "html" to always use the HTML uploader. An empty string (default) will check for the right version of Flash and use HTML if not available.

hoverClass

The name of the class that will style the button in a "hover" state. A specific class should be made to do this. Do not rely on a target like button:hover{...}

htmlFieldName

The name of the field of the fileInput that the server is expecting

id

The object id, just like any other widget in Dojo. However, this id is also used as a reference for the SWF

insideNode

The div that holds the SWF and form/fileInput

isDebug

If true, outputs traces from the SWF to console. What exactly gets passed is very relative, and depends upon what traces have been left in the DEFT SWF.

lang
Defined by: dijit/_WidgetBase

Rarely used. Overrides the default Dojo locale used to render this widget, as defined by the HTML LANG attribute. Value must be among the list of locales specified during by the Dojo bootstrap, formatted according to RFC 3066 (like en-us).

minFlashVersion

The minimum of version of Flash player to target. 0 would always install Flash, 100 would never install it. The Flash Player has supported multiple uploads since version 8, so it could go as low as that safely.

ownerDocument
Defined by: dijit/_WidgetBase

The document this widget belongs to. If not specified to constructor, will default to srcNodeRef.ownerDocument, or if no sourceRef specified, then to the document global

progressBackgroundColor

The background color to use for the button-progress

progressBackgroundUrl

The background image to use for the button-progress

progressMessage

The message shown while the button is changed to a progress bar

progressWidgetId

The widget id of a Dijit Progress bar. The Uploader will bind to it and update it automatically.

searchContainerNode
Defined by: dijit/_TemplatedMixin
selectMultipleFiles

If true and flash mode, multiple files may be selected from the dialog. If html mode, files are not uploaded until upload() is called. The references to each file is incremented:uploadedfile0, uploadedfile1, uploadedfile2... etc.

serverTimeout

The amount of time given to the uploaded file to wait for a server response. After this amount of time, the onComplete is fired but with a 'server timeout' error in the returned item.

showProgress

If true, the button changes to a progress bar during upload.

skipServerCheck

If true, will not verify that the server was sent the correct format. This can be safely set to true. The purpose of the server side check is mainly to show the dev if they've implemented the different returns correctly.

srcNodeRef
Defined by: dijit/_WidgetBase

pointer to original DOM node

style
Defined by: dijit/_WidgetBase

HTML style attributes as cssText string or name/value hash

swfPath
tabIndex

The tab order in the DOM. Only supported by Flash. HTML Uploaders have security protection to prevent you from tabbing to the uploader. Stupid.

templatePath
Defined by: dijit/_TemplatedMixin

Path to template (HTML file) for this widget relative to dojo.baseUrl. Deprecated: use templateString with require([... "dojo/text!..."], ...) instead

templateString
title
Defined by: dijit/_WidgetBase

HTML title attribute.

For form widgets this specifies a tooltip to display when hovering over the widget (just like the native HTML title attribute).

For TitlePane or for when this widget is a child of a TabContainer, AccordionContainer, etc., it's used to specify the tab label, accordion pane title, etc. In this case it's interpreted as HTML.

tooltip
Defined by: dijit/_WidgetBase

When this widget's title attribute is used to for a tab label, accordion pane title, etc., this specifies the tooltip to appear when the mouse is hovered over that text.

uploaderType

Internal. What type of uploader is being used: "flash" or "html"

uploadOnChange

If true, uploads immediately after a file has been selected. If false, waits for upload() to be called.

uploadUrl

The url targeted for upload. An absolute URL is preferred. Relative URLs are changed to absolute.

version

1.5 (deprecated)

Methods

_addToFileList()

Internal only. If there is a file list, adds a file to it. If you need to use a function such as this, connect to onChange and update outside of this widget.

_animateProgress()

Internal. Animated the built-in progress bar

_applyAttributes()
Defined by dijit/_WidgetBase

Step during widget creation to copy widget attributes to the DOM according to attributeMap and _setXXXAttr objects, and also to call custom _setXXXAttr() methods.

Skips over blank/false attribute values, unless they were explicitly specified as parameters to the widget, since those are the default anyway, and setting tabIndex="" is different than not setting tabIndex at all.

For backwards-compatibility reasons attributeMap overrides _setXXXAttr when _setXXXAttr is a hash/string/array, but _setXXXAttr as a functions override attributeMap.

_attach(node,type,func)
Defined by dijit/_AttachMixin

Roughly corresponding to dojo/on, this is the default function for processing a data-dojo-attach-event. Meant to attach to DOMNodes, not to widgets.

Parameter Type Description
node DOMNode

The node to setup a listener on.

type String

Event name like "click".

func undefined
Returns:undefined
_attachTemplateNodes(rootNode)
Defined by dijit/_AttachMixin

Iterate through the dom nodes and attach functions and nodes accordingly.

Map widget properties and functions to the handlers specified in the dom node and it's descendants. This function iterates over all nodes and looks for these properties:

  • dojoAttachPoint/data-dojo-attach-point
  • dojoAttachEvent/data-dojo-attach-event
Parameter Type Description
rootNode DomNode

The node to search for properties. All descendants will be searched.

_attrToDom(attr,value,commands)
Defined by dijit/_WidgetBase

Reflect a widget attribute (title, tabIndex, duration etc.) to the widget DOM, as specified by commands parameter. If commands isn't specified then it's looked up from attributeMap. Note some attributes like "type" cannot be processed this way as they are not mutable.

Parameter Type Description
attr String

Name of member variable (ex: "focusNode" maps to this.focusNode) pointing to DOMNode inside the widget, or alternately pointing to a subwidget

value String
commands Object
Optional
_beforeFillContent()
Defined by dijit/_AttachMixin
_buildFileInput()

Build the fileInput field

_buildForm()

Build the form that holds the fileInput

_change(dataArray)

Internal. Updates uploader selection

Parameter Type Description
dataArray undefined
_changeAttrValue(name,value)
Defined by dojo/Stateful

Internal helper for directly changing an attribute value.

Directly change the value of an attribute on an object, bypassing any accessor setter. Also handles the calling of watch and emitting events. It is designed to be used by descendant class when there are two values of attributes that are linked, but calling .set() is not appropriate.

Parameter Type Description
name String

The property to set.

value Mixed

The value to set in the property.

Returns:function

Internal helper for directly changing an attribute value.

_checkHtmlCancel(mouseType)

Internal. Check if the dialog was opened and canceled without file selection.

Parameter Type Description
mouseType undefined
_complete(dataArray)

Internal. Handles tasks after files have finished uploading

Parameter Type Description
dataArray undefined
_connectFlash()

Subscribing to published topics coming from the Flash uploader.

Sacrificing some readability for compactness. this.id will be on the beginning of the topic, so more than one uploader can be on a page and can have unique calls.

_connectInput()

Internal. HTML Uploader connections. These get disconnected after upload or if multi upload.

_detachTemplateNodes()
Defined by dijit/_AttachMixin

Detach and clean up the attachments made in _attachtempalteNodes.

_disconnect()

Internal. Disconnects fileInput in favor of new one.

_displayProgress(display)

Shows and updates the built-in progress bar.

Parameter Type Description
display Boolean or Number
_doSub(subStr,funcStr)

Internal. Shortcut for subscribes to Flash movie

Parameter Type Description
subStr undefined
funcStr undefined
_error(evt)
Parameter Type Description
evt undefined
_escapeValue(val)

Escape a value to be inserted into the template, either into an attribute value (ex: foo="${bar}") or as inner text of an element (ex: ${foo})

Parameter Type Description
val String
Returns:undefined
_fillContent(source)

Relocate source contents to templated container node. this.containerNode must be able to receive children, or exceptions will be thrown.

Parameter Type Description
source DomNode
_get(name)
Defined by dijit/_WidgetBase

Helper function to get value for specified property stored by this._set(), i.e. for properties with custom setters. Used mainly by custom getters.

For example, CheckBox._getValueAttr() calls this._get("value").

Parameter Type Description
name String
Returns:undefined
_getAttrNames(name)
Defined by dijit/_WidgetBase

Helper function for get() and set(). Caches attribute name values so we don't do the string ops every time.

Parameter Type Description
name undefined
Returns:undefined | object
_getDisabledAttr()

Internal. To get disabled use: widget.get("disabled");

Returns:undefined
_getSibling(which)
Defined by dijit/_Contained

Returns next or previous sibling

Parameter Type Description
which String

Either "next" or "previous"

Returns:undefined
_introspect()
Defined by dijit/_WidgetBase

Collect metadata about this widget (only once per class, not once per instance):

- list of attributes with custom setters, storing in this.constructor._setterAttrs
- generate this.constructor._onMap, mapping names like "mousedown" to functions like onMouseDown
_processTemplateNode(baseNode,getAttrFunc,attachFunc)
Defined by dijit/_AttachMixin

Process data-dojo-attach-point and data-dojo-attach-event for given node or widget. Returns true if caller should process baseNode's children too.

Parameter Type Description
baseNode DOMNode | Widget
getAttrFunc Function

Function to get the specified property for a given DomNode/Widget.

attachFunc Function
Optional

Attaches an event handler from the specified node/widget to specified function.

Returns:boolean
_progress(dataObject)

Internal. Calculate progress

Parameter Type Description
dataObject undefined
_renumberInputs()
_resetHTML()

Internal. After upload, this is called to clear the form and build a new fileInput.

_set(name,value)
Defined by dijit/_WidgetBase

Helper function to set new value for specified property, and call handlers registered with watch() if the value has changed.

Parameter Type Description
name String
value anything
_setDisabledAttr(disabled)

Internal. To set disabled use: widget.set("disabled", true | false);

Parameter Type Description
disabled undefined
_setFocusedAttr(val)
Defined by dijit/_Widget
Parameter Type Description
val undefined
_setFormStyle()

Apply a dynamic style to the form and input

_setHtmlPostData()

Internal.Apply postData to hidden fields in form

_setOwnerDocumentAttr(val)
Defined by dijit/_WidgetBase
Parameter Type Description
val undefined
_setStyleAttr(value)
Defined by dijit/_WidgetBase

Sets the style attribute of the widget according to value, which is either a hash like {height: "5px", width: "3px"} or a plain string

Determines which node to set the style on based on style setting in attributeMap.

Parameter Type Description
value String | Object
_stringRepl(tmpl)

Does substitution of ${foo} type properties in template string

Parameter Type Description
tmpl undefined
Returns:undefined
_styleContent()

Internal.Apply style to node

attr(name,value)
Defined by dijit/_Widget

This method is deprecated, use get() or set() directly.

Parameter Type Description
name String | Object

The property to get or set. If an object is passed here and not a string, its keys are used as names of attributes to be set and the value of the object as values to set in the widget.

value Object
Optional

Optional. If provided, attr() operates as a setter. If omitted, the current value of the named property is returned.

Returns:undefined
buildRendering()
Defined by dijit/_WidgetBase

Construct the UI for this widget, setting this.domNode. Most widgets will mixin dijit._TemplatedMixin, which implements this method.

connect(obj,event,method)
Defined by dijit/_WidgetBase

Deprecated, will be removed in 2.0, use this.own(on(...)) or this.own(aspect.after(...)) instead.

Connects specified obj/event to specified method of this object and registers for disconnect() on widget destroy.

Provide widget-specific analog to dojo.connect, except with the implicit use of this widget as the target object. Events connected with this.connect are disconnected upon destruction.

Parameter Type Description
obj Object | null
event String | Function
method String | Function
Returns:any | undefined

A handle that can be passed to disconnect in order to disconnect before the widget is destroyed.

Examples

Example 1

var btn = new Button();
// when foo.bar() is called, call the listener we're going to
// provide in the scope of btn
btn.connect(foo, "bar", function(){
    console.debug(this.toString());
});
create(params,srcNodeRef)
Defined by dijit/_WidgetBase

Kick off the life-cycle of a widget

Create calls a number of widget methods (postMixInProperties, buildRendering, postCreate, etc.), some of which of you'll want to override. See http://dojotoolkit.org/reference-guide/dijit/_WidgetBase.html for a discussion of the widget creation lifecycle.

Of course, adventurous developers could override create entirely, but this should only be done as a last resort.

Parameter Type Description
params Object | null

Hash of initialization parameters for widget, including scalar values (like title, duration etc.) and functions, typically callbacks like onClick. The hash can contain any of the widget's properties, excluding read-only properties.

srcNodeRef DOMNode | String
Optional

If a srcNodeRef (DOM node) is specified:

  • use srcNodeRef.innerHTML as my contents
  • if this is a behavioral widget then apply behavior to that srcNodeRef
  • otherwise, replace srcNodeRef with my generated DOM tree
createFlashUploader()

Internal. Creates Flash Uploader

createHtmlUploader()

Internal. Fires of methods to build HTML Uploader.

defer(fcn,delay)
Defined by dijit/_WidgetBase

Wrapper to setTimeout to avoid deferred functions executing after the originating widget has been destroyed. Returns an object handle with a remove method (that returns null) (replaces clearTimeout).

Parameter Type Description
fcn Function

Function reference.

delay Number
Optional

Delay, defaults to 0.

Returns:object
destroy()

Destroys uploader button

destroyDescendants(preserveDom)
Defined by dijit/_WidgetBase

Recursively destroy the children of this widget and their descendants.

Parameter Type Description
preserveDom Boolean
Optional

If true, the preserveDom attribute is passed to all descendant widget's .destroy() method. Not for use with _Templated widgets.

destroyRecursive(preserveDom)
Defined by dijit/_WidgetBase

Destroy this widget and its descendants

This is the generic "destructor" function that all widget users should call to cleanly discard with a widget. Once a widget is destroyed, it is removed from the manager object.

Parameter Type Description
preserveDom Boolean
Optional

If true, this method will leave the original DOM structure alone of descendant Widgets. Note: This will NOT work with dijit._TemplatedMixin widgets.

destroyRendering(preserveDom)
Defined by dijit/_WidgetBase

Destroys the DOM nodes associated with this widget.

Parameter Type Description
preserveDom Boolean
Optional

If true, this method will leave the original DOM structure alone during tear-down. Note: this will not work with _Templated widgets yet.

disconnect(handle)
Defined by dijit/_WidgetBase

Deprecated, will be removed in 2.0, use handle.remove() instead.

Disconnects handle created by connect.

Parameter Type Description
handle undefined
emit(type,eventObj,callbackArgs)
Defined by dijit/_WidgetBase

Used by widgets to signal that a synthetic event occurred, ex:

myWidget.emit("attrmodified-selectedChildWidget", {}).

Emits an event on this.domNode named type.toLowerCase(), based on eventObj. Also calls onType() method, if present, and returns value from that method. By default passes eventObj to callback, but will pass callbackArgs instead, if specified. Modifies eventObj by adding missing parameters (bubbles, cancelable, widget).

Parameter Type Description
type String
eventObj Object
Optional
callbackArgs Array
Optional
Returns:undefined
get(name)
Defined by dijit/_WidgetBase

Get a property from a widget.

Get a named property from a widget. The property may potentially be retrieved via a getter method. If no getter is defined, this just retrieves the object's property.

For example, if the widget has properties foo and bar and a method named _getFooAttr(), calling: myWidget.get("foo") would be equivalent to calling widget._getFooAttr() and myWidget.get("bar") would be equivalent to the expression widget.bar2

Parameter Type Description
name undefined

The property to get.

Returns:undefined
getButtonStyle()

Internal. Get necessary style information from srcRefNode and assigned styles

getChildren()
Defined by dijit/_WidgetBase

Returns all direct children of this widget, i.e. all widgets underneath this.containerNode whose parent is this widget. Note that it does not return all descendants, but rather just direct children. Analogous to Node.childNodes, except containing widgets rather than DOMNodes.

The result intentionally excludes internally created widgets (a.k.a. supporting widgets) outside of this.containerNode.

Note that the array returned is a simple array. Application code should not assume existence of methods like forEach().

Returns:Array
getDescendants()
Defined by dijit/_Widget

Returns all the widgets contained by this, i.e., all widgets underneath this.containerNode. This method should generally be avoided as it returns widgets declared in templates, which are supposed to be internal/hidden, but it's left here for back-compat reasons.

Returns:Array
getHiddenNode(node)

Internal. If a parent node is styled as display:none, returns that node. This node will be temporarilly changed to display:block. Note if the node is in a widget that has an onShow event, this is overridden.

Parameter Type Description
node DomNode
Returns:null | undefined
getIndexInParent()
Defined by dijit/_Contained

Returns the index of this widget within its container parent. It returns -1 if the parent does not exist, or if the parent is not a dijit/_Container

Returns:number | undefined
getNextSibling()
Defined by dijit/_Contained

Returns null if this is the last child of the parent, otherwise returns the next element sibling to the "right".

Returns:undefined
getParent()
Defined by dijit/_WidgetBase

Returns the parent widget of this widget.

Returns:undefined
getPreviousSibling()
Defined by dijit/_Contained

Returns null if this is the first child of the parent, otherwise returns the next element sibling to the "left".

Returns:undefined
getStyle(node)
Parameter Type Description
node undefined
Returns:object
getTempNodeStyle(node,_class,isDijitButton)
Parameter Type Description
node undefined
_class undefined
isDijitButton undefined
Returns:undefined
getText(node)
Parameter Type Description
node undefined
Returns:undefined
getTextStyle(node)
Parameter Type Description
node undefined
Returns:object
isButton(node)
Parameter Type Description
node undefined
Returns:boolean
isFocusable()
Defined by dijit/_WidgetBase

Return true if this widget can currently be focused and false if not

Returns:undefined
isLeftToRight()
Defined by dijit/_WidgetBase

Return this widget's explicit or implicit orientation (true for LTR, false for RTL)

Returns:undefined
log()

Due to the excessive logging necessary to make this code happen, It's easier to turn it on and off here in one place. Also helpful if there are multiple uploaders on one page.

on(type,func)
Defined by dijit/_Widget
Parameter Type Description
type String | Function

protected

func Function
Returns:undefined
own()
Defined by dijit/Destroyable

Track specified handles and remove/destroy them when this instance is destroyed, unless they were already removed/destroyed manually.

Returns:any | undefined

The array of specified handles, so you can do for example:

var handle = this.own(on(...))[0];
placeAt(reference,position)
Defined by dijit/_WidgetBase

Place this widget somewhere in the DOM based on standard domConstruct.place() conventions.

A convenience function provided in all _Widgets, providing a simple shorthand mechanism to put an existing (or newly created) Widget somewhere in the dom, and allow chaining.

Parameter Type Description
reference String | DomNode | DocumentFragment | dijit/_WidgetBase

Widget, DOMNode, DocumentFragment, or id of widget or DOMNode

position String | Int
Optional

If reference is a widget (or id of widget), and that widget has an ".addChild" method, it will be called passing this widget instance into that method, supplying the optional position index passed. In this case position (if specified) should be an integer.

If reference is a DOMNode (or id matching a DOMNode but not a widget), the position argument can be a numeric index or a string "first", "last", "before", or "after", same as dojo/dom-construct::place().

Returns:dijit/_WidgetBase | function

Provides a useful return of the newly created dijit._Widget instance so you can "chain" this function by instantiating, placing, then saving the return value to a variable.

Examples

Example 1

// create a Button with no srcNodeRef, and place it in the body:
var button = new Button({ label:"click" }).placeAt(win.body());
// now, 'button' is still the widget reference to the newly created button
button.on("click", function(e){ console.log('click'); }));

Example 2

// create a button out of a node with id="src" and append it to id="wrapper":
var button = new Button({},"src").placeAt("wrapper");

Example 3

// place a new button as the first element of some div
var button = new Button({ label:"click" }).placeAt("wrapper","first");

Example 4

// create a contentpane and add it to a TabContainer
var tc = dijit.byId("myTabs");
new ContentPane({ href:"foo.html", title:"Wow!" }).placeAt(tc)
postCreate()
postMixInProperties()
postscript(params,srcNodeRef)
Defined by dijit/_WidgetBase

Kicks off widget instantiation. See create() for details.

Parameter Type Description
params Object
Optional
srcNodeRef DomNode | String
removeFile(name,noListEdit)

Removes a file from the pending file list. Removes pending data from the Flash movie and fileInputes from the HTML uploader. If a file container node is bound, the file will also be removed.

Parameter Type Description
name String

The name of the file to be removed. Typically the file name, such as: picture01.png

noListEdit Boolean

Internal. If true don't remove files from list.

set(name,value)
Defined by dijit/_WidgetBase

Set a property on a widget

Sets named properties on a widget which may potentially be handled by a setter in the widget.

For example, if the widget has properties foo and bar and a method named _setFooAttr(), calling myWidget.set("foo", "Howdy!") would be equivalent to calling widget._setFooAttr("Howdy!") and myWidget.set("bar", 3) would be equivalent to the statement widget.bar = 3;

set() may also be called with a hash of name/value pairs, ex:

myWidget.set({
    foo: "Howdy",
    bar: 3
});

This is equivalent to calling set(foo, "Howdy") and set(bar, 3)

Parameter Type Description
name undefined

The property to set.

value undefined

The value to set in the property.

Returns:function | string

Set a property on a widget

setAttribute(attr,value)
Defined by dijit/_Widget

Deprecated. Use set() instead.

Parameter Type Description
attr String
value anything
setButtonStyle()

Internal. Set up internal dom nodes for button construction.

startup()
submit(form)

If FileUploader is in a form, and other data should be sent along with the files, use this instead of form submit.

Parameter Type Description
form form node
Optional
Returns:boolean
subscribe(t,method)
Defined by dijit/_WidgetBase

Deprecated, will be removed in 2.0, use this.own(topic.subscribe()) instead.

Subscribes to the specified topic and calls the specified method of this object and registers for unsubscribe() on widget destroy.

Provide widget-specific analog to dojo.subscribe, except with the implicit use of this widget as the target object.

Parameter Type Description
t String

The topic

method Function

The callback

Returns:undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
toString()
Defined by dijit/_WidgetBase

Returns a string that represents the widget.

When a widget is cast to a string, this method will be used to generate the output. Currently, it does not implement any sort of reversible serialization.

Returns:string
uninitialize()
Defined by dijit/_WidgetBase

Deprecated. Override destroy() instead to implement custom widget tear-down behavior.

Returns:boolean
unsubscribe(handle)
Defined by dijit/_WidgetBase

Deprecated, will be removed in 2.0, use handle.remove() instead.

Unsubscribes handle created by this.subscribe. Also removes handle from this widget's list of subscriptions

Parameter Type Description
handle Object
upload(data)

When called, begins file upload

Parameter Type Description
data Object
Optional

postData to be sent to server

Returns:boolean
uploadFlash()

Internal. You should use upload() or submit();

uploadHTML()

Internal. You could use this, but you should use upload() or submit(); which can also handle the post data.

urlencode(url)
Parameter Type Description
url undefined
Returns:boolean | undefined
watch(name,callback)
Defined by dojo/Stateful

Watches a property for changes

Parameter Type Description
name String
Optional

Indicates the property to watch. This is optional (the callback may be the only parameter), and if omitted, all the properties will be watched

callback Function

The function to execute when the property changes. This will be called after the property has been changed. The callback will be called with the |this| set to the instance, the first argument as the name of the property, the second argument as the old value and the third argument as the new value.

Returns:any | object

An object handle for the watch. The unwatch method of this object can be used to discontinue watching this property:

var watchHandle = obj.watch("foo", callback);
watchHandle.unwatch(); // callback won't be called now

Events

_onBlur()
Defined by: dijit/_FocusMixin

This is where widgets do processing for when they stop being active, such as changing CSS classes. See onBlur() for more details.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
_onFlashBlur()

Internal. Detects when Flash movies reliquishes focus. We have to find all the tabIndexes in the doc and figure out whom to give focus to next.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
_onFocus()
Defined by: dijit/_FocusMixin

This is where widgets do processing for when they are active, such as changing CSS classes. See onFocus() for more details.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
_onMap(type)
Defined by: dijit/_WidgetBase

Maps on() type parameter (ex: "mousemove") to method name (ex: "onMouseMove"). If type is a synthetic event like touch.press then returns undefined.

Parameter Type Description
type String | Function
Returns:undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
_onShow()
Defined by: dijit/_Widget

Internal method called when this widget is made visible. See onShow for details.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onBlur()
Defined by: dijit/_FocusMixin

Called when the widget stops being "active" because focus moved to something outside of it, or the user clicked somewhere outside of it, or the widget was hidden.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onCancel()

Stub to connect Fires when dialog box has been closed without a file selection

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onChange(dataArray)

stub to connect Fires when files are selected Event is an array of last files selected

Parameter Type Description
dataArray undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onClick(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of mouse click events.

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onClose()
Defined by: dijit/_Widget

Called when this widget is being displayed as a popup (ex: a Calendar popped up from a DateTextBox), and it is hidden. This is called from the dijit.popup code, and should not be called directly.

Also used as a parameter for children of dijit/layout/StackContainer or subclasses. Callback if a user tries to close the child. Child will be closed if this function returns true.

Returns:boolean

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onComplete(dataArray)

stub to connect Fires when all files have uploaded Event is an array of all files

Parameter Type Description
dataArray undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onDblClick(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of mouse double click events.

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onError(evtObject)

Fires on errors

Parameter Type Description
evtObject Object or String

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onFocus()
Defined by: dijit/_FocusMixin

Called when the widget becomes "active" because it or a widget inside of it either has focus, or has recently been clicked.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onHide()
Defined by: dijit/_Widget

Called when another widget becomes the selected pane in a dijit/layout/TabContainer, dijit/layout/StackContainer, dijit/layout/AccordionContainer, etc.

Also called to indicate hide of a dijit.Dialog, dijit.TooltipDialog, or dijit.TitlePane.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onKeyDown(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of keys being pressed down.

Parameter Type Description
event undefined

key Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onKeyPress(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of printable keys being typed.

Parameter Type Description
event undefined

key Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onKeyUp(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of keys being released.

Parameter Type Description
event undefined

key Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onLoad(uploader)

Stub - SWF has been downloaded 100%.

Parameter Type Description
uploader dojox.form.FileUploader

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onMouseDown(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of when the mouse button is pressed down.

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onMouseEnter(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of when the mouse moves onto this widget.

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onMouseLeave(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of when the mouse moves off of this widget.

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onMouseMove(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of when the mouse moves over nodes contained within this widget.

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onMouseOut(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of when the mouse moves off of nodes contained within this widget.

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onMouseOver(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of when the mouse moves onto nodes contained within this widget.

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onMouseUp(event)
Defined by: dijit/_Widget

Connect to this function to receive notifications of when the mouse button is released.

Parameter Type Description
event undefined

mouse Event

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onProgress(dataArray)

Stub to connect Fires as progress returns from SWF Event is an array of all files uploading Can be connected to for HTML uploader, but will not return anything.

Parameter Type Description
dataArray undefined

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onReady(uploader)

Stub - Fired when embedFlash has created the Flash object, but it has not necessarilly finished downloading, and is ready to be communicated with.

Parameter Type Description
uploader dojox.form.FileUploader

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
onShow()
Defined by: dijit/_Widget

Called when this widget becomes the selected pane in a dijit/layout/TabContainer, dijit/layout/StackContainer, dijit/layout/AccordionContainer, etc.

Also called to indicate display of a dijit.Dialog, dijit.TooltipDialog, or dijit.TitlePane.

Examples

Example 1

var btn = new Button();
// when /my/topic is published, this button changes its label to
// be the parameter of the topic.
btn.subscribe("/my/topic", function(v){
    this.set("label", v);
});
Error in the documentation? Can’t find what you are looking for? Let us know!