+ Start a Discussion
SF_Gh0stSF_Gh0st 

What is the tab ID?

Hi,
In my VF page, I see the following code. 'Research' is a custom object. Where or how do I find out how they got that id for the tab?
<apex:tab label="Research" style="white-space:nowrap" name="research" id="tab17".......

 
Best Answer chosen by SF_Gh0st
David Zhu 🔥David Zhu 🔥
Vinay provided a good resource to understand the purpose of id attribute. 

I just want to explain this in detail with example.

Id attribute for Apex:tab component (and other VF components) is often referenced by reRender attbitute of apex:commandButton and apex:commandLink.

For example, with the following code, if the button is clicked, the tab with id "tab17" will be redrawn. Other section on the same page won't be redrawn.

<apex:commandButton value="Refresh Tab" action="{!doSomething}" rerender="tab17"/>

You can search 'tab17" in your VF page to check how and where it is referenced.

All Answers

VinayVinay (Salesforce Developers) 
Hi,

ID is an identifier that allows the tab component to be referenced by other components in the page.

https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_tab.htm

Thanks,
Vinay Kumar
David Zhu 🔥David Zhu 🔥
Vinay provided a good resource to understand the purpose of id attribute. 

I just want to explain this in detail with example.

Id attribute for Apex:tab component (and other VF components) is often referenced by reRender attbitute of apex:commandButton and apex:commandLink.

For example, with the following code, if the button is clicked, the tab with id "tab17" will be redrawn. Other section on the same page won't be redrawn.

<apex:commandButton value="Refresh Tab" action="{!doSomething}" rerender="tab17"/>

You can search 'tab17" in your VF page to check how and where it is referenced.
This was selected as the best answer