关闭对话框后无法将焦点放在字段上

Unable to put focus on a field after closing dialogbox

在我的 XPages 应用程序中,我试图在对话框关闭后将焦点设置在作为 bootstrap 日期选择器的字段上:

XSP.closeDialog('#{id:dlgLMAValidDate}');
//I thought this would work but is does not
//$('#{id:inpLMAValid}').focus();
//alternative attempt:
//does not work either
var el = XSP.getElementById('#{id:inpLMAValid}');
var ef = dojo.byId(el);
ef.focus();

我想知道我做错了什么?

以下对我有用:

XSP.closeDialog('#{id:dlgLMAValidDate}');
var el = XSP.getElementById('#{id:inpLMAValid}');
el.focus();
el.scrollIntoView();