Do you pass --generateJsInteropExports to GWT? I think that's now required
for @JsFunctionâ‹…s to be callable from JS.
On Thursday, September 1, 2016 at 5:59:41 PM UTC+2, Teletin Alin wrote:
>
> 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 [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/google-web-toolkit-contributors/ca5d337d-f6d4-4f85-bf1a-353cbab193a5%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.