Results 1 to 5 of 5

Thread: FileUpload field doesn`t allow same filename!?

  1. #1
    Sencha User
    Join Date
    Jul 2009
    Posts
    64

    Default FileUpload field doesn`t allow same filename!?

    Hello,

    my fileUpload webapp is allready running.
    But i don`t understand why the uploadfield isn`t able to redraw the same path/filename
    when i uploaded my file to the server and the uploadPanel ist resetted to default values.

    i alllready try to call:
    fileuploadfield.repaint()
    fileuploadfield.recalculate();
    fileuploadfield.clearState();
    fileuploadfield.setRawValue("");

    But the result is the same...no path/filename will be displayed after selecting the same file....

  2. #2

    Default Me too

    I'm having the same problem. Using Firebug I've been able to determine that the 'change' event doesn't fire when you click the Browse button if you select the same file that was selected previously, even though my code performed a setValue() to change the value of the field between uses of the Browse button.

    At this point I'm stuck.

  3. #3

    Default Found a solution

    OK, I figured out how to make this work, at least for the way I'm doing it.

    When my code does a setValue() on the field, I added another line that clears the dom value of the fileInput.

    Code:
     
    var fileNameField = uploadForm.findField("File Name");
        fileNameField.setValue(myValue);
        fileNameField.fileInput.dom.value = "";
    By clearing the dom.value it will always fire the change event the next time you click the Browse button.

  4. #4
    Sencha - Services Team
    Join Date
    Mar 2007
    Location
    Foristell, MO
    Posts
    1,121

    Default

    Quote Originally Posted by joejernst View Post
    OK, I figured out how to make this work, at least for the way I'm doing it.

    When my code does a setValue() on the field, I added another line that clears the dom value of the fileInput.

    Code:
     
    var fileNameField = uploadForm.findField("File Name");
        fileNameField.setValue(myValue);
        fileNameField.fileInput.dom.value = "";
    By clearing the dom.value it will always fire the change event the next time you click the Browse button.
    Thanks for posting this. I was having the same problem.

  5. #5
    Sencha User
    Join Date
    Jul 2009
    Posts
    64

    Default

    Thx for reply,

    i did not find the equal methods for java.
    Finally i use this solution:

    Code:
    
    fileuploadfield.getFileInput().getForm().reset();
    

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •