-
1. Re: java script in rich faces
ilya_shaikovsky Mar 25, 2010 5:56 AM (in response to krishnakishu)if you mean that need to set focus after some ajax request - check focus attribute of any ajax component. And if after some client actions - yes you could do it with js.
-
2. Re: java script in rich faces
krishnakishu Mar 25, 2010 6:07 AM (in response to ilya_shaikovsky)Hi Ilya,
I am not using any ajax actions. I just have 2 text boxes, first is username and second is password is text boxes.
After the form is loaded, I want to focus my cursor in the username text box.
I have attached the code. Please suggest.
In the java script method, when the first line is uncommented, that line is being executed, but the third line is not being executed.
-
login.txt.zip 917 bytes
-
-
3. Re: java script in rich faces
ilya_shaikovsky Mar 30, 2010 8:37 AM (in response to krishnakishu)<script>
function focusOnUserName(){
jQuery('#usrLogin\\:usrName').focus();
} // End of function focusOnUserNamejQuery(document).ready(function() {focusOnUserName()});
</script> -
4. Re: java script in rich faces
krishnakishu Mar 31, 2010 12:19 AM (in response to ilya_shaikovsky)Thanks Ilya,
It worked for me.
Thanks a lot.