2013-08-28 48 views

回答

0
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>