SmartGWT 元素在 Chrome 和 Chrome 中不接收鼠标事件狩猎之旅

发布于 2024-12-13 23:48:44 字数 1980 浏览 1 评论 0原文

我正在使用 smartGWT 2.5 开发一个模块,我的 html 起始页如下:

<html>
<head>
<title>Test App</title>
<script> var isomorphicDir = "testApp/sc/"; </script>
<script src="testApp/sc/modules/ISC_Core.js"></script>
<script src="testApp/sc/modules/ISC_Foundation.js"></script>
<script src="testApp/sc/modules/ISC_Containers.js"></script>
<script src="testApp/sc/modules/ISC_Grids.js"></script>
<script src="testApp/sc/modules/ISC_Forms.js"></script>
<script src="testApp/sc/modules/ISC_RichTextEditor.js"></script>
<script src="testApp/sc/modules/ISC_DataBinding.js"></script>
<script>
currentSkin = "Enterprise";
document.write("<"+"script src=\"testApp/sc/skins/" + currentSkin + "/load_skin.js?isc_version=7.1.js\"><"+"/script>");
</script>
<script src="testApp/testApp.nocache.js"></script>
</head>
<body>

<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>

</body>
</html>

&这是我的entryPoing 实现:

public class testApp extends SmartGwtEntryPoint {

    @Override
    public void onModuleLoad() {
        final DynamicForm form = new DynamicForm();
        form.setWidth100();
        form.setHeight100();

        ButtonItem loginButton = new ButtonItem("loginButton", "Login");  
        loginButton.addClickHandler(new ClickHandler() {  
            public void onClick(ClickEvent event) {  
                SC.say("Test!");
            }
        });
        form.setFields(loginButton);

        VLayout mainLayout = new VLayout();
        mainLayout.setHeight100();
        mainLayout.setWidth100();
        mainLayout.addMember(form);
        mainLayout.draw();
 }
}

我的起始页成功启动&显示创建的表单的登录按钮,但问题是它不适用于鼠标单击(但适用于键盘按键),似乎该按钮没有接收任何鼠标事件。
我仅在 chrome 和 chrome 中遇到此问题safari,但在 firefox 中工作正常。
有什么想法吗?

I'm using smartGWT 2.5 to develope a module, my html start page is as below:

<html>
<head>
<title>Test App</title>
<script> var isomorphicDir = "testApp/sc/"; </script>
<script src="testApp/sc/modules/ISC_Core.js"></script>
<script src="testApp/sc/modules/ISC_Foundation.js"></script>
<script src="testApp/sc/modules/ISC_Containers.js"></script>
<script src="testApp/sc/modules/ISC_Grids.js"></script>
<script src="testApp/sc/modules/ISC_Forms.js"></script>
<script src="testApp/sc/modules/ISC_RichTextEditor.js"></script>
<script src="testApp/sc/modules/ISC_DataBinding.js"></script>
<script>
currentSkin = "Enterprise";
document.write("<"+"script src=\"testApp/sc/skins/" + currentSkin + "/load_skin.js?isc_version=7.1.js\"><"+"/script>");
</script>
<script src="testApp/testApp.nocache.js"></script>
</head>
<body>

<iframe id="__gwt_historyFrame" style="width:0;height:0;border:0"></iframe>

</body>
</html>

& this is my entryPoing implementation :

public class testApp extends SmartGwtEntryPoint {

    @Override
    public void onModuleLoad() {
        final DynamicForm form = new DynamicForm();
        form.setWidth100();
        form.setHeight100();

        ButtonItem loginButton = new ButtonItem("loginButton", "Login");  
        loginButton.addClickHandler(new ClickHandler() {  
            public void onClick(ClickEvent event) {  
                SC.say("Test!");
            }
        });
        form.setFields(loginButton);

        VLayout mainLayout = new VLayout();
        mainLayout.setHeight100();
        mainLayout.setWidth100();
        mainLayout.addMember(form);
        mainLayout.draw();
 }
}

My start page successfully initiates & shows the Login button of the created form, but the problem is that it does NOT work with mouse clicks(but works with keyboard key press), seems that the button does not receive any of mouse events.
I've this problem ONLY in chrome & safari, but it works correctly in firefox.
any idea?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

情绪失控 2024-12-20 23:48:44

此代码不会重现问题(在任何浏览器中)。需要调查的事项:

  1. 您是否有非常旧的 GWT 版本,或者是否有多个 GWT 副本?

  2. 您的 .gwt.xml 中是否有可能干扰第三方库的其他继承?

  3. 您的 Safari 或 Chrome 中是否有导致问题的浏览器扩展?

如果您无法立即找到原因,请在第二台计算机上进行全新安装,以便您可以看到代码或 SmartGWT 没有问题,然后返回对损坏的环境的特殊情况进行故障排除。

This code doesn't reproduce the problem (in any browser). Things to look into:

  1. Do you have a very old version of GWT, or perhaps more than one copy of GWT around?

  2. Do you have additional inherits in your .gwt.xml for third-party libraries which might be interfering?

  3. Do you have browser extensions in Safari or Chrome that are causing a problem?

If you can't immediately find the cause, do a clean install on a second machine just so that you can see that there's no problem with your code or SmartGWT, then return to troubleshooting what's special about the broken environment.

心作怪 2024-12-20 23:48:44

Chrome 中的 AddBlock 扩展给我带来了这个问题!

AddBlock extension in Chrome caused this issue for me!

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文