Hi all,

I have a problem with an upload button which sends the selected file to a 
servlet and takes some action on servlet response.
This is the code:

//all ESExtXXX or ExtXXX from following code are wrapped javascript with 
jsinterop
                ESExtCreateParams *uploadPanelParams* = new 
ESExtCreateParams();
uploadPanelParams.setWidth(60);
uploadPanelParams.setHeight(24);
uploadPanelParams.setLayout("fit");
ExtFormPanel *panelForm* = (ExtFormPanel) ESExt.create("Ext.form.Panel", 
uploadPanelParams);

ESExtCreateParams *loadButtonParams* = new ESExtCreateParams();
loadButtonParams.setButtonText("LoadJsonFile");
loadButtonParams.setAutoHeight(true);
// loadButtonParams.setAutoWidth(true);
loadButtonParams.setHideLabel(true);
loadButtonParams.setButtonOnly(true);
loadButtonParams.setFlex(1);
ExtFormFile *loadButton* = (ExtFormFile) 
ESExt.create("Ext.form.field.File", loadButtonParams);
loadButton.addListener("change", new ESStandardFunction() {

@Override
public void exec() {
ExtFormBasic *basicForm* = panelForm.getForm();

JsOptions options = new JsOptions();
options.setUrl("urlToMyServlet");
options.setMethod("POST");
options.setWaitMsg("Please wait...");
options.setFileUpload(true);
options.setSuccess(new JsSubmitFunction() {

@Override
public void exec(ExtFormBasic basic, ExtFormSubmit action) {
*JavaScriptObject result = action.getResult();*
useJsonData(JsonUtils.stringify(result));
loadButton.reset();
}
});
options.setFailure(new JsSubmitFunction() {

@Override
public void exec(ExtFormBasic basic, ExtFormSubmit action) {
*loadButton.reset();*
}
});

basicForm.submit(options);
}
});

panelForm.add(loadButton);

This panelForm is added to a ext toolbar which is used in a GWT app.

*As I saw, I can choose a file to upload, that file goes to my servlet, my 
servlet does its job, but the bold code(functions from on success or on 
failure) is not called. It should be called when servlet response is 
returned.*
I do have in the result a json containing "success" : true or false.

This code works with gwt2.8.0-beta1 but not with gwt2.8.0-rc1 or rc2.

Any suggestions?

Thank you,
AlinT.

-- 
You received this message because you are subscribed to the Google Groups "GWT 
Contributors" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to google-web-toolkit-contributors+unsubscr...@googlegroups.com.
To view this discussion on the web visit 
https://groups.google.com/d/msgid/google-web-toolkit-contributors/b8930437-e1fc-412f-8955-53995647e86c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to