You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wicket.apache.org by rjohara <oh...@genome.chop.edu> on 2008/09/11 22:24:35 UTC

Re: setDefaultButton validation problems and javascript errors in IE 6 and 7

I'm having a similar problem.  Although clicking the button works fine,
pressing enter to submit a form is causing the following exception in IE:

A runtime error has occurred. Do you wish to Debug?

Line: 47
Error: 'onclick' is null or not an object

Code looks something like:

    public Login() {
        TabbedHeader loginTabbedHeader = new
TabbedHeader("loginTabbedHeader");
        add(loginTabbedHeader);
        Form form = new Form("login", new CompoundPropertyModel(this));
        add(form);
        form.add(new TextField("email"));
        form.add(new PasswordTextField("password"));

        final CnvFeedback cnvFeedback = new CnvFeedback("feedbackPanel");
        add(cnvFeedback);
        Button asl = new Button("submit") {
            public void onSubmit() {
                try {
                    if (signIn(email, password)) {
                        User cnvUser = new User(email, password, 0);
                        ((MySession) getSession()).setUser(cnvUser);
                        setResponsePage(Search.class);
                    } else {
                        throw new Exception("Incorrect email and password. 
Please try again.");
                    }
                } catch (Exception e) {
                    cnvFeedback.warnFeedback(e.getMessage());
                }
            }
        };
        form.add(asl);
        form.setDefaultButton(asl);
        add(new Footer("footer"));
    }
-- 
View this message in context: http://www.nabble.com/setDefaultButton-validation-problems-and-javascript-errors-in-IE-6-and-7-tp17265035p19443809.html
Sent from the Wicket - Dev mailing list archive at Nabble.com.