• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Tim Cooke
  • Jeanne Boyarsky
  • Ron McLeod
Sheriffs:
Saloon Keepers:
  • Piet Souris
Bartenders:

JSF2 Focus on field and JavaScript injection from code

 
Greenhorn
Posts: 1
Java Ubuntu Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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)?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic