function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
sampath pallisampath palli 

How to create different vf pages as tabs

I have an requirement that i need to make different vf pages as tabs for example
i have created 4 vf pages with different components like input&output. I need to make these pages as tabs for a site

Thanks in Advance 
Mahesh DMahesh D
Hi Sampath,

Using the Visualforce Component as a tab and you can create on VF page with 4 tabs and each tab will contain a specific component.

You can try below solutions:

Please do let me know if it helps you.

JyothsnaJyothsna (Salesforce Developers) 
Hi Sampath,

You can achieve the above scenario by using Visualforce component.
Please check the below sample code.

VisualForce Page
<apex:page >
 <apex:tabPanel >
 <apex:tab label="Customer Information">
 <legend>customer details </legend>
 <c:tabbedviewcomp1 ></c:tabbedviewcomp1>
 <apex:tab label="Address">
 <c:tabbedviewcomp2 ></c:tabbedviewcomp2>

Visualforce Component
<apex:component controller="tab2control">
  <apex:form >
  <apex:pageBlock >
  <apex:pageBlockButtons location="bottom">
  <apex:commandButton value="Save" action="{!save1}"/>
  <table cellspacing='15'>
  <tr><th>Billing Street</th>
<td>  <apex:inputField value="{!c.Billing_Street__c}"/></td>
<th>billing city</th>
<td><apex:inputField value="{!c.Billing_City__c}"/></td></tr>

Output Preview

User-added image

Hope this helps you!
Best Regards,
Galeeb SKGaleeb SK
what we write in controller class