posted 16 years ago
Hi everyone!
I'v been looking for the solution how to get focus on the text input field all day long.
Previously i was using Jsf1.2 with icefaces, and JavaScriptContext.addJavaScriptCall("document.getElementById('form:inputfield').focus()") did the job but now i'm using only JSF2 (mojarra) with primefaces, and there is now JavaScriptContext class.
So my questiona are:
how in JSF2 make focus on field (preferably without javascript)
and how to include in jsf2 javascript code from java bean (not the js from external file but simply js as a string)?