【问题标题】:GWT, GXT HtmlEditor, Key EventGWT、GXT HtmlEditor、关键事件
【发布时间】:2010-11-03 02:47:09
【问题描述】:

无论我尝试什么,当我添加 addListener(Events.KeyPress, new Listener() { 公共无效句柄事件(字段事件 e){ 改变=真; } });

或

    addKeyListener(new KeyListener() {
        public void componentKeyDown(ComponentEvent event) {
            changed = true;
        }
    });

没有记录...事件未被捕获。任何人都知道如何使这项工作?

谢谢。 柯特

【问题讨论】:

    标签: gwt gxt html-editor


    【解决方案1】:

    目前您必须扩展 HtmlEditor 并覆盖 onEditorKeyDown()。

    class ExtendedHtmlEditor extends HtmlEditor {
    
        public ExtendedHtmlEditor() {
            super();
        }
    
        @Override
        protected void onEditorKeyDown(KeyDownEvent e) {
            super.onEditorKeyDown(e);
            Window.alert("w000t");
        }
    
    }
    

    另见here。

    【讨论】:

    • 是的,这也适用于我......但我的问题没有说明标准 GWT TextArea,是吗?
    • 好吧,我后来发现 GXT HtmlEditor 没有实现任何事件处理程序,所以我必须扩展该类并实现我自己的。有人有实现 KeyDownHandler 的链接或示例代码吗?谢谢。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多