1
我从the demo of Richfaces Showcase中创建了焦点文本框中的示例项目。我使用JSF 2.0,Richfaces 4.3.0 Final.jar和Jboss 7服务器。我可以成功运行该项目,但重点无法正常工作。当我按Tab键时,焦点到达文本框。如果有什么我需要合作,请告诉我。Richbox中的文本框焦点
在此先感谢。
我从the demo of Richfaces Showcase中创建了焦点文本框中的示例项目。我使用JSF 2.0,Richfaces 4.3.0 Final.jar和Jboss 7服务器。我可以成功运行该项目,但重点无法正常工作。当我按Tab键时,焦点到达文本框。如果有什么我需要合作,请告诉我。Richbox中的文本框焦点
在此先感谢。
Finally, I got it. I put the javascript code in the jsf form just like this.
<h:form id="frm">
<script type="text/javascript">
window.onload = function() {
document.getElementById('frm:txtStaffId').focus();
}
</script>
...
...
<h:inputText id="txtStaffId"/>
...
...
</h:form>