Menu in Visualforce | Tab Panel


Visual Force

<apex:page sidebar="false" showHeader="false" controller="gesdatas">
<style>
.menu
{
background-color:#000;
width:100px;
color:#fff;
background-image:none;
border:none;
height:30px;
}
.zx
{
border:1px solid #f50;
background-color:#909090;
}
.active
{
background-color:#000;
}
.notactive
{
background-color:#a07dff;
}
</style>
     <apex:tabPanel tabClass="zx" selectedTab="active" inactiveTabClass="notactive" >
     <apex:tab name="Home" label="Home" id="one" styleClass="menu" title="home">
     <h1>this is title</h1>
     <p>This is Menu in SalesforceDeveloperspoint</p>
     <p>This is Menu in SalesforceDeveloperspoint</p>
    <apex:pageBlock >
    <apex:pageblockTable value="{!datas}" var="da">
       <apex:column value="{!da.id}"/>
        <apex:column value="{!da.name}"/>
     
    </apex:pageblockTable>
    </apex:pageBlock>
    <apex:pageBlock >
    <apex:pageblockTable value="{!bkfld}" var="fld">
       <apex:column value="{!fld.id}"/>
        <apex:column value="{!fld.name}"/>
          <apex:column value="{!fld.price__c}"/>
           <apex:column value="{!fld.Description__c}"/>
     
     
    </apex:pageblockTable>
    </apex:pageBlock>
      </apex:tab>
      <apex:tab label="Contacts" name="Contacts" id="tabContact" styleClass="menu">
 
    <apex:detail relatedList="false" title="true"/>

</apex:tab>
  <apex:tab name="About Us" label="About Us" id="two" styleClass="menu" title="about">ggggggggggg</apex:tab>
   <apex:tab name="Contact Us" label="Contact Us" id="three" styleClass="menu" title="contact">
    <apex:pageBlock >
    <apex:insert name="header"></apex:insert>
    <apex:pageblockTable value="{!bkfld}" var="fld">
     
           <apex:column value="{!fld.Description__c}"/>
     
     
    </apex:pageblockTable>
    </apex:pageBlock></apex:tab>
   </apex:tabPanel>
</apex:page>

Controller


public class gesdatas {

    public List<Book__c> bkfld { get; set; }

    public String getBkfld() {
        return null;
    }


  public List<Schema.Account> datas {get;set;}

    public String getDatas() {
        return null;
    }
    public gesdatas ()
    {
    datas=[SELECT id,name from Account];
    system.debug(datas);
    bkfld=[SELECT id,name,price__c,Description__c from Book__c];


}
 

}

Output :


Comments

Popular posts from this blog

Community/Experience Cloud Interview Questions

Script to delete multiple records using Apex salesforce

Change Owner / Update record using Lightning Custom Button Salesforce