My form doesn't want to send request (watching its activity through
Firefox Firebug)
This is my client code:

public class UploadForm extends FormPanel{
    private HorizontalPanel content = new HorizontalPanel();
    private Label uploadLabel= new Label("Choose file");
    private FileUpload fileUpload = new FileUpload();
    private Button uploadButton = new Button("Upload");

    public UploadForm(){
        super();
        this.setAction("/data/uploadfile");
        this.setEncoding(FormPanel.ENCODING_MULTIPART);
        this.setMethod(FormPanel.METHOD_POST);
        this.setWidget(content);

        fileUpload.setName("fileUpload");

        content.add(uploadLabel);
        content.add(fileUpload);
        content.add(uploadButton);


        uploadButton.addClickHandler(new ClickHandler() {
            public void onClick(ClickEvent event) {
                UploadForm.this.submit();
            }
        });

        this.addSubmitHandler(new SubmitHandler() {
            public void onSubmit(SubmitEvent event) {
                Window.alert("onSubmit");
            }
        });

        this.addSubmitCompleteHandler(new SubmitCompleteHandler() {
           public void onSubmitComplete(SubmitCompleteEvent event) {
                Window.alert("onSubmitComplete");
            }
        });

    }
}

So, I see my Form in the HTML code (taken using FireBug):

<form target="FormPanel_1" action="/data/uploadfile"
enctype="multipart/form-data" method="post">
    <table cellspacing="0" cellpadding="0">
        <tbody>
            <tr>
                <td align="left" style="vertical-align: top;">
                    <div class="gwt-Label">Choose file</div>
                </td>
                <td align="left" style="vertical-align: top;">
                    <input type="file" class="gwt-FileUpload"/>
                </td>
                <td align="left" style="vertical-align: top;">
                    <button tabindex="0" type="submit" class="gwt-
Button">Upload</button>
                </td>
            </tr>
        </tbody>
    </table>
</form>

As you can see it's real form with multipart and method post

BUT!
When clicking on the button, I get first Window.alert("onSubmit"); and
then second Window.alert("onSubmitComplete");

Form doesn' sends request!!!
I don't see any requests in FireBug (but I have to), My Tomcat server
keeps silence, but it has to write into log somrthing like: "resource
is not found"

Is it a miracle or stupid mistake?
Please help me to overcome this difficulty.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/Google-Web-Toolkit?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to