Hi guys,

I've a RESTful webservice that returns xml/json and it works properly. 

If I submit a HTML form to that webservice, Firefox and Chrome shows the 
XML file, but when I try to submit a GWT FormPanel, on the onSubmitComplete 
callback, SubmitCompleteEvent.getResults() always returns null.

Here is my HTML code:

<html>
    <body>
        <form method="POST" 
action="http://localhost:8080/myWebService/entry";>
            <input type="email" id="email" name="email" width="10"><br>
            <input type="password" id="password" name="password" 
width="10"><br>
            <input type="submit" value="Test">
        </form>
    </body>
</html>

Here is my GWT Code:

    public void onModuleLoad() {
        final FormPanel formPanel = new FormPanel();
        formPanel.setEncoding(FormPanel.ENCODING_URLENCODED);
        formPanel.setMethod(FormPanel.METHOD_POST);

        VerticalPanel verticalPanel = new VerticalPanel();

        verticalPanel.add(new Label("Username"));
        TextBox userid = new TextBox();
        userid.setName("email");
        verticalPanel.add(userid);

        verticalPanel.add(new Label("Password"));
        PasswordTextBox passwd = new PasswordTextBox();
        passwd.setName("password");
        verticalPanel.add(passwd);

        verticalPanel.add(new Button("Submit", new ClickHandler() {
            public void onClick(ClickEvent event) {
                formPanel.submit();
            }
        }));

        formPanel.add(verticalPanel);
        formPanel.setAction("http://localhost:8080/myWebService/entry";);
        formPanel.addSubmitCompleteHandler(new 
FormPanel.SubmitCompleteHandler() {
            public void onSubmitComplete(SubmitCompleteEvent event) {
               Window.alert(event.getResults());
            }
        });

        RootPanel.get().add(formPanel);    
    }

What am I doing wrong? Am I forgetting something? Is there any SOP 
restriction? How do I bypass this issue?

Thanks in advance.

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/google-web-toolkit?hl=en.
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to