|
View:
New views
3 Messages
—
Rating Filter:
Alert me
|
|
|
Transfering a file using DWR 3.0 disables the "input" eventsBasically, I connect the "onchange" events of an "<input type="file" >" and when the event is fired, I call a function that transfer the file to the server. All works fine, (the callback function is executed)... but the input doesn't fire the 'onchange' event anymore. The problem is common to Firefox, Chrome and IE. I'm not really sure if this is an Issue or is the correct behaviour. here you are an example of code: HTML: <input type="file" id="theFileInputId" /> JAVASCRIPT: constructor:function() { var fileInput = dojo.byId("theFileInputId"); dojo.connect(fileInput, "onchange",this, "_onUploadFileChange"); }, _onUploadFileChange: function(evt){ var input = evt.target; JVirtualDocumentSrv.addDocument(dwr.util.getValue(input), {callback: function(data){console.debug("file uploaded:" + data.name);},}) }} JAVA public class JVirtualDocumentSrv { public void addDocument( FileTransfer file ) throws Exception { InputStream in = file.getInputStream(); try { createFile(file.getName(), in); } finally { in.close(); } } ... Charlas más divertidas con el nuevo Windows Live Messenger |
|
|
Re: Transfering a file using DWR 3.0 disables the "input" eventsYes, it's replaced by another input file
On Thu, Jun 18, 2009 at 12:08 PM, Antonio Cabrera <antoniocabreraperez@...> wrote:
|
|
|
Re: Transfering a file using DWR 3.0 disables the "input" eventsDWR pollutes the file object attributes and changes it's name prior to posting it so it clones it and swaps prior to doing a post. I guess we could be smarter here and revert the original back to it's original state instead.
Hopefully there's a simple workaraound for your problem. 2009/6/18 Jose Noheda <jose.noheda@...> Yes, it's replaced by another input file |
| Free embeddable forum powered by Nabble | Forum Help |