Software Development

How to make a tab selected by default in Pimefaces

Background

[wp_ad_camp_1]

This article demonstrates how make any tab selected or activated by default.

Software Environment

  • Windows 7 Professional SP1
  • Eclipse – Kepler Release
  • Java 1.7 (1.7.0_67 – Windows x86)
  • JSF 2.2
    • Downloaded, and referenced as part of a Dynamic Web Project in Eclipse
  • Primefaces 4.0
    • Downloaded from www.primefaces.org
    • Place it in the project in WebContent\WEB-INF\lib and reference it

Your Facelet

[wp_ad_camp_2]

To make a tab selected by default, modify your tabView and use activeIndex attribute. Set it to 0, 1, or (n-1)th tab. 0 (zero) selects the left-most tab.

[wp_ad_camp_3]

Loading

Got comments or suggestions? We disabled the comments on this site to fight off spammers, but you can still contact us via our Facebook page!.


You Might Also Like