I noticed a bug in 1.1.0 release. If you place a button inside
FormPanel, then if you click the button it will submit the form in all
browsers except IE. You can use this code to fix the problem:
package com.whatever.gwt.client;
import com.google.gwt.user.client.Element;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.ClickListener;
public class FormButton extends Button {
/**
* Creates a button with no caption.
*/
public FormButton() {
super();
fixButton(getElement());
}
/**
* Creates a button with the given HTML caption.
*
* @param html
* the HTML caption
*/
public FormButton(String html) {
super(html);
fixButton(getElement());
}
/**
* Creates a button with the given HTML caption and click listener.
*
* @param html
* the HTML caption
* @param listener
* the click listener
*/
public FormButton(String html, ClickListener listener) {
super(html, listener);
fixButton(getElement());
}
public static native void fixButton(Element e) /*-{
if (e.type == 'submit') {
e.type = 'button';
}
}-*/;
}
Hope this helps,
Alexei
-Ian
-Vivian
Thank you both.