PDA

View Full Version : Multipart FormPanel unusable with files without accept-charset?



mbatsis
2 Dec 2011, 5:06 AM
We are having a showstopper encoding issue with FormPanel when used to upload files. The HTML form is set to "multipart/form-data" but the API does not allow to change that to "multipart/form-data; charset=utf-8" or set the HTML form's accept-charset attribute to the desired charset.

A subclass cannot help since the FormPanel's form member is private and no getters are provided. I tried JSNI but it did not seem to work.

Am I missing something here or should a



public El getForm(){
return this.form;
}


getter be added to the FormPanel class?

Colin Alworth
2 Dec 2011, 5:40 AM
Almost - check out http://code.google.com/webtoolkit/doc/latest/DevGuideCodingBasicsJSNI.html#methods-fields for more information on how to do this.

Untested, but probably should look like

public El getForm(){
return this.@com.extjs.gxt.ui.client.widget.form.FormPanel::form;
}