这是我的代码:
package com.eggproject_hu.WPECommerceAdminSales.client;
import java.lang.Boolean;
import com.google.gwt.core.client.GWT;
import com.google.gwt.user.client.Window;
public class AblakVillogo
{
public static Boolean focusedWindow = true;
private static Boolean init = false;
public static void setFocused(Boolean focus)
{
focusedWindow = focus;
}
public static Boolean getFocused()
{
return focusedWindow;
}
public static void focusVizsgalat()
{
if(focusedWindow == true)
{
GWT.log("igen");
}
else
{
GWT.log("nem");
}
}
public static void init()
{
if(init == false)
{
_init();
}
}
private native static void _init() /*-{
$wnd.jQuery(document).ready(function()
{
$wnd.jQuery($wnd).focus(function()
{
@com.eggproject_hu.WPECommerceAdminSales.client.AblakVillogo::focusVizsgalat()(); @com.eggproject_hu.WPECommerceAdminSales.client.AblakVillogo::setFocused(Ljava/lang/Boolean;)(true);
$wnd.console.log("focus");
}).blur(function()
{
var ret = false;
@com.eggproject_hu.WPECommerceAdminSales.client.AblakVillogo::focusVizsgalat()();
@com.eggproject_hu.WPECommerceAdminSales.client.AblakVillogo::setFocused(Ljava/lang/Boolean;)(false);
$wnd.console.log("blur");
});
});
}-*/;
}
我在浏览器控制台中看到了这个:
未捕获的异常:java.lang.IllegalArgumentException:调用参数:布尔类型的 JS 值,预期为 java.lang.Boolean
我已经在 Chrome 和 Firefox 中进行了测试。
问题是什么?
谢谢您的帮助!