• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 23
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
I miss the old days when I would think up a sinister scheme for world domination and you would show a little emotional support. So just look at this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic