0

我正在尝试在 Kepler 中使用带有 GWTQuery-UI 的对话框,但不知道出了什么问题。我尽我所能遵循https://code.google.com/p/gwtquery-ui/wiki/GettingStarted上的说明。我有以下代码设置

gwt.xml

    <inherits name='gwtquery.plugins.UiGoogleCdn' />  
    <inherits name='gwtquery.plugins.UiEmbedded' />

我也试过 gwtquery.plugins.Ui 但这也没有解决问题。

在我的 java 文件中,我有以下内容

import static com.google.gwt.query.client.GQuery.*;
import static gwtquery.plugins.ui.Ui.Ui;
import com.google.gwt.query.client.Function;

我在项目的 html 中有以下内容。

<div style="display: none;" class="gwt-DlgBox">This is a test to see if this shows up</div>

在主要逻辑中,我有以下点击处理程序

@UiHandler("btnShow")
public void btnShow(ClickEvent event)
{
        int x = 0;
    try
    {
            x = $(".gwt-DlgBox").length();
        $(".gwt-DlgBox").as(Ui).dialog();
    }
    catch(Throwable e)
    {
        e=e;  // just so I can debug break here.
    }
}

调试时出现错误:第 80 行:引用方法 'com.google.gwt.query.client.Function.f(Lcom/google/gwt/user/client/Event;Ljava/lang/Object;)': 无法解决方法

当我单步执行代码时 x = 1; 这是正确的,但 .dialog() 行因上述错误而失败。

当我尝试编译它时,我收到以下错误

[错误] 'jar:file:/C:/src/gwtquery-ui-r146.jar!/gwtquery/plugins/ui/UiWidget.java' 中的错误 [错误] 第 80 行:引用方法 'com.google.gwt. query.client.Function.f(Lcom/google/gwt/user/client/Event;Ljava/lang/Object;)':无法解析方法

任何帮助,将不胜感激。是的,我是 GWT 的新手,只是不明白我缺少什么。

谢谢。

4

1 回答 1

0

如果您使用的是 gwtquery 1.4.2,则可能是问题所在。我通过降级到 gwtquery 1.3.3 解决了这个问题。

于 2014-10-01T19:19:57.940 回答