BUG: FireFox Submit in FormPanel (v1.1.0)

36 views
Skip to first unread message

Mark Rieck

unread,
Aug 14, 2006, 11:44:45 PM8/14/06
to Google Web Toolkit
I made a simple test using the FormPanel:

public class FormTest implements EntryPoint {

private Button submitButton;

public void onModuleLoad()
{
final FormPanel form = new FormPanel();
final VerticalPanel vPanel = new VerticalPanel();
TextBox tb = new TextBox();
tb.setName("testfield");
submitButton = new Button("Submit");

vPanel.add(tb);
vPanel.add(submitButton);

//Form Post properties
form.setAction("submittest.php");
form.setEncoding(FormPanel.ENCODING_URLENCODED);
form.setMethod(FormPanel.METHOD_POST);
form.setWidget(vPanel);

submitButton.addClickListener(new ClickListener()
{
public void onClick(Widget sender)
{
form.submit();
}
});

// Add an event handler to the form.
form.addFormHandler(new FormHandler()
{
public void onSubmitComplete(FormSubmitCompleteEvent event) {
Window.alert("Result: " + event.getResults());
}

public void onSubmit(FormSubmitEvent event) {
submitButton.setText("Please Wait...");
submitButton.setEnabled(false);
}
});

RootPanel.get("slot1").add(form);
}
}

I'm using a PHP file to process the form data. When deployed to the
server, IE sends the form correctly, but Firefox doesn't send anything.
The php file is just:

<?php
if(isset($_POST['testfield']))
echo "Success";
else
echo "Failure";
?>

I'm using Firefox 1.5.0.6.

Hmm, I just saw this thread:
http://groups.google.com/group/Google-Web-Toolkit/browse_thread/thread/72bea3a6d4feeaeb
That fixes it. If I replace the Button with his FormButton, it works.
Hope you can get that in the next release.

-Mark


P.S. Since I haven't already thanked you guys for GWT yet, thank you!
As a former C# WinForms developer, working with Java is so much easier
than learning 20 different ways of doing it in javascript. The 1.1.0
release is good, but I was hoping for 'url encoding for asyncPost()'
and now that forms are here... 'hidden input fields'. At the pace
you're going I'm sure you'll get around to it. Keep up the great work!

Reply all
Reply to author
Forward
0 new messages