2013-07-19 77 views
0

我有一个链接点击该链接,可以在文本框中编辑该链接的名称。GWT:当我编辑文本框并保存时,焦点消失

enter image description here

编辑后保存并关闭选项出现。保存完成后,焦点从链接中消失,我需要将重点放在链接上。

enter image description here

我使用

Scheduler.get().scheduleDeferred(new ScheduledCommand() { 
public void execute() { 
    link.setFocus(true); 
} 
}); 

的链接,但将重点为仅次于不是永久该链接。 寻找解决方案。

谢谢.. !!

+0

是否尝试过'setFocus(true)'点击保存并关闭选项? – pratZ

+0

是的,我只使用这个 –

+0

在保存/关闭'clickhandler'内的编辑面板的'hide()'之后使用它。如果你在这里发布一些代码会好得多。 – pratZ

回答

0

在关闭并保存按钮点击处理程序中使用以下代码。

Scheduler.get().scheduleDeferred(new ScheduledCommand() { 
    public void execute() { 
     link.setFocus(true); 
    } 
});. 
+0

是的。 GWT中的setFocus我总是在scheduler.get()里面使用..... !!这是行不通的 –

+0

使用此代码(不在外面)关闭并保存按钮的'clickhandler',我没有看到一个点链接失去其重点。我遇到过类似的问题,但这对我来说工作得很好。 – pratZ

相关问题