Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jsf-2/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Jsf 2 <;p:focus在p:tabView中时不起作用_Jsf 2_Primefaces_Focus - Fatal编程技术网

Jsf 2 <;p:focus在p:tabView中时不起作用

Jsf 2 <;p:focus在p:tabView中时不起作用,jsf-2,primefaces,focus,Jsf 2,Primefaces,Focus,根据您的提示,我用以下方法解决问题: onTabShow="tabShowHandler()" 和javascript部分: function tabShowHandler() { var inputUsername = $('#tabView\\:frmRegister\\:username'); inputUsername.focus(); } 更新第二个tab或者使用jquery focus和tab客户端api,类似这样的onTabChange=“jquery('.\som

根据您的提示,我用以下方法解决问题:

onTabShow="tabShowHandler()"
和javascript部分:

function tabShowHandler() {
   var inputUsername = $('#tabView\\:frmRegister\\:username');
   inputUsername.focus();
}

更新第二个tab
或者使用jquery focus和tab客户端api,类似这样的
onTabChange=“jquery('.\someForm\\\:someTab\\:someInput')。focus();”