Can anyone tell me how to highlight the command link(similar to tabs) in visualforce page?
For example There are four command links in my vfp.
like commandlink1,commandlink2,commandlink3 and commandlink4. Each link must has a page
when i click the second link then it will display second page with highlighting the second command link and others would be disabled.
same for other links..

Any help would be greatly appreciated.

Thanks in advance


1 Answer 1


It sounds like you want to use tabs, there is an apex:tabpanel VF component but the UI it generates is hideously outdated (or at least it was last time I checked!).

You could use the jQuery UI tab: http://jqueryui.com/tabs/

I've successfully implemented this before but be warned the jQuery UI library will manipulate the DOM which can cause issues with some Visualforce components.

Don't forget to use

    var $j = jQuery.noConflict();

if you start using jQuery in your VF page.

  • Is there any mthod other than jquery Dec 12, 2014 at 6:16
  • You could use the styleClass attribute of the command link to apply a css style to make it look like it's highlighted. If they exist on different pages you can simply hard code it, if you do a full postback when they are clicked you can use the controller to control which one has the highlight css or if its part postback reRender the links and use the controller or use Javascript to change the css class applied.
    – Force Hero
    Dec 12, 2014 at 7:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .