2013-08-28 75 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>