Closed GoogleCodeExporter closed 9 years ago
Added the patch to SVN. THX Justin!
Original comment by mlim1...@gmail.com
on 30 Sep 2008 at 6:20
Revised the code since setting values was not getting set. The code now checks
the
type and if it is of type 'file' then the code will not set the dom.value:
setValue : function(v){
this.value = v;
if(this.rendered){
if(this.type != 'file'){
this.el.dom.value = (v === null || v === undefined ? '' : v);
}
this.validate();
}
}
Original comment by mlim1...@gmail.com
on 7 Oct 2008 at 4:21
This fix doesn't work in firefox (it produce security errors), becouse field
has
undefined type value when it is checked. I overrided setValue method to check
name
value:
setValue : function(v){
this.value = v;
if(this.rendered){
if(this.name != 'file'){
this.el.dom.value = (v === null || v === undefined ? '' : v);
}
this.validate();
}
}
It also need to override BrowseButton getFileField method to set field name:
private TextField getFileField(String name) {
JavaScriptObject inputFile = detachInputFile(false);
ExtElement e = new ExtElement(inputFile);
e.getDOM().setAttribute("name", name);
TextField tf = new TextField(null, "file");
tf.setInputType("file");
tf.setEl(e.getDOM());
return tf;
}
Then it will be working!
Original comment by yuppy...@gmail.com
on 7 Jan 2009 at 5:00
Original issue reported on code.google.com by
justin.t...@gmail.com
on 25 Sep 2008 at 4:18Attachments: