PDA

View Full Version : How to know if FormPanel Submit was successul?



brunonandolpho
21 Aug 2009, 5:06 AM
I saw many posts about fileuploading withe ext-gwt
It works fine so far!
but, I'm wondering how I can react on a successful uploading of the file? I don't have any callback or something! Is there a mechanism to react of a successful submit() ?


i tryed in the FormPanel:

this.setMethod(Method.POST);
this.setEncoding(Encoding.MULTIPART);
this.setAction(fileUploadAction);

this.addListener(Events.Submit, new Listener<FormEvent>() {
public void handleEvent(FormEvent arg0) {
MessageBox.alert("File submited");
//do something

}
}
but it did not work....any help?

seu31199113
23 Aug 2009, 10:30 PM
It seems that a lot of people were concerned about this issue.

lucasdeoliveira
24 Aug 2009, 8:10 AM
Hi,
There is a thread about that (http://extjs.com/forum/showthread.php?p=376726&posted=1#post376726) but unfortunately no answer was given so far. If one of you guys solve that please write the solution here so we can get on with our lives :D

cheers!

aclsoftware
2 Sep 2009, 4:49 AM
Any update?

lucasdeoliveira
2 Sep 2009, 5:36 AM
Any update?

not really, but you can take a look at a more promissing discussions here:

http://extjs.com/forum/showthread.php?p=376726&posted=1#post376726

Feltros
3 Sep 2009, 6:41 AM
Telling whether it succeeded or not is tied in with getting a file upload progress bar working. To do so your fileupload servlet has to be constantly responding with messages (telling how far its progressing) and thus will respond on success also. Then you can go about telling whether it succeeded or not.
Presumably at the moment your servlet just takes the file and stores it. Get a progress bar working and you've got your success status too. Was playing about with this back in GWT1.5 GXT1.2 and there were people on the forum who had it working (but few discussions properly explaining it). I gave up in the end, but I found java servlet forums were a far better place to look for how to get your servlet to talk about how the upload was going.

In other words - search for getting a working progress bar on fileuploads, not for telling when the file is finished.

lucasdeoliveira
3 Sep 2009, 6:59 AM
hello there Feltros,

I gave up in the end, but I found java servlet forums were a far better place to look for how to get your servlet to talk about how the upload was going.

In other words - search for getting a working progress bar on fileuploads, not for telling when the file is finished.

that's a great advice, although it seems very strange that extjs have the proper event to treat this situation (meaning that you shouldn't need a progress bar in order to make this thing work). Still, if you have some servlet that does the job and if you can share its code would be awesome.

thanks a lot!
cheers!

Feltros
3 Sep 2009, 7:24 AM
Unfortunately not, as I said I gave up with things and got rid of the extraneous code. Would love to see a full tutorial on it oneday though.