Reputation: 22847
I'm just trying to incorporate dojox/form/Uploader
into my application, which is using Dojo 1.9.2 (AMD). The documentation http://dojotoolkit.org/reference-guide/1.10/dojox/form/Uploader.html#dojox-form-uploader is quite outdated, for example Dojo screamed not to import dojox.form.uploader.plugins.Flash
through require
, because it's already built-in, so my example after adaptations is looking like that (jsfiddle):
<form class="claro">
<div id="uploader"></div>
</form>
require(['dojox/form/Uploader', "dojo/domReady!"], function(Uploader){
var u = new dojox.form.Uploader({
label: "Select files",
multiple: true,
uploadOnSelect: false,
url: "/my/rest/file/upload",
}, "uploader");
})
However, the problem is, that nothing happens whel I click the 'Select files' button. Neither on Firefox, nor on IE 11.
What I need to do to use Uploader component with newer version of Dojo?
Upvotes: 0
Views: 214
Reputation: 1600
The Uploader widget is just declared. It needs to be instantiated. Add the following line after the declaration.
u.startup();
Now, the widget would work. Here is the jsFiddle
require(['dojox/form/Uploader', "dojo/domReady!"], function(Uploader){
var u = new dojox.form.Uploader({
label: "Select files",
multiple: true,
uploadOnSelect: false,
url: "/my/rest/file/upload",
}, "uploader");
u.startup();
});
Upvotes: 1