1

我的应用程序中有一些按钮:

private class MyForm extends Form<Parametry> {

    private static final long serialVersionUID = 1L;
    public MyForm(final Parametry parametry) {
        add(new AjaxButton("1") { .... }
        add(new AjaxButton("2") { .... }
        add(new Button("run") {
            private static final long serialVersionUID = 1L;

            @Override
            public void onSubmit() {
                logger.error("???????????????????" + parametry.getDatum());
            }
        });
    }
}

在 Firefox 和 Chrome 中一切正常,但我对 IE8 有问题。Ajax 按钮工作正常,但是当我按下按钮时没有任何反应。只是页面是新的(?x= ?x+1),但logger没有写任何东西。

我该如何解决?


更新:我使用的是 1.5.7 版。当我删除 ajaxButton 一切正常。


UPDATE2:我用wireshark查看通讯:

火狐:

POST /rob-mon/statistika?5-4.IFormSubmitListener-statistikaForm HTTP/1.1

这应该很好。

IE9:

GET /rob-mon/statistika?4-1.IBehaviorListener.0-statistikaForm&random=0.2323892690702561 HTTP/1.1

为什么要使用GET方法?

4

2 回答 2

1

As an alternative, can't you override onSubmit for your Form instead of for the button? You could even lose the button and keep a simple <input type="submit" /> not tied to Wicket, which should work I think.

于 2012-10-29T12:51:13.170 回答
0

Wicket AjaxButtons work by adding to an onclick event to the element. Do you have any js library which could be interfering with the onclick event handler wicket generates? I recall having some issue with a placeholder plugin.

Option 2: use AjaxFallbackButton ?

于 2012-10-30T21:37:09.130 回答