Unwanted stack trace popup on form commit

Hie

I implemented required field validation on my form using:

subscribeform.getField(“emailId”).setRequired(true);
subscribeform.getField(“emailId”).setRequiredError(“Email id is missing”);

and the commit button is like:
Button subscribeButton = new Button(“Subscribe”, subscribeform, “commit”);

I see a nice form level message when i hit the Subscribe button in case field is empty.
Another lovely thing i notice is marking the button as well with a red error icon.

However, when i hover over the subscribe button it shows another popup showing the complete stack trace. I dont want users to see that. So how to disable this thing?

Vik
http://adfjsf.blogspot.com

If an error occurs in the commit - in this case a required field is empty, the error is thrown as an exception for the one calling commit(). As the button is the one calling commit, but doesn’t handle the exception by itself, the exception is handled by the framework. Default way of handling errors is to put them in the components causing the error - unfortunately in most cases this is not a good way of handling these errors. In order to override this, set an error handler for the application.

public class ForumtestApplication extends Application {
    @Override
    public void init() {
        Window mainWindow = new Window("Test Application");
        setMainWindow(mainWindow);

        mainWindow.addComponent(new Button("test", new Button.ClickListener() {
            public void buttonClick(ClickEvent event) {
                throw new RuntimeException();
            }
        }));

        setErrorHandler(new Terminal.ErrorListener() {
            public void terminalError(Terminal.ErrorEvent event) {
                event.getThrowable().printStackTrace();
            }
        });

    }
}

works nice… thankx for this…