Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

How to make focus to the button during onload in JSF if the button is in tabbedPane using javascrip

 
soma lingam
Greenhorn
Posts: 22
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi

i am using JSF and i need an help in how we can make focus to a button during onload , the button need to get focus which is in tabbedPane tab Name : (Search Critera1) using javascript. any help on this
 
Tim Holloway
Saloon Keeper
Posts: 18367
56
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Basically, it's the same process that you'd go through for non-JSF pages.

The one difference is that when you use Javascript of JSF pages, the ids of the objects you reference in the javascript code must be the generated HTML IDs and not the JSF "id=" id values. Use your browser's "show source" feature to see the generated ID if you're confused.

Also note that the generated ID is a concatenation of the simple (JSF) id plus the IDs of the naming container(s) that it is nested in. If you didn't give them explicit IDs then they are given synthesized IDs (such as "j_121"). You don't want that because the synthetic ID values can change unpredictably, so always supply an explict id= value for the naming containers.

Naming containers include forms and tables, among other things.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic