You need to sign in to do that
Don't have an account?
LBS
Issues with SwitchType together with sidebar and showHeader
Hi There,
Im recently developing a form using VF pages and with tabbed interface. I noticed that eventhough I have included the SwitchType property to client on my tabpanel, i couldn't navigate among tabs.
But when i set either the sidebar or showHeader properties to false on the Apex:page, I was able to navigate among tabs. It was realy frustating and not what i wanted at all. Please kindly help me on this. Here is my VF code.
<apex:page standardController="Custom_object__c" showHeader="true" sidebar="true" id="thePage" tabStyle="Custom_object__c">
<apex:sectionHeader title="Test" subtitle="Test"/>
<style>
.activeTab {background-color: #236FBD; color:white;
background-image:none}
.inactiveTab { background-color: lightgrey; color:black;
background-image:none}
</style>
<apex:tabPanel switchType="client" id="TabPanel" selectedTab="tabMain" inactiveTabClass="inactiveTab" activeTabClass="activeTab">
<apex:tab label="Main" name="MainTab" id="tabMain">
<apex:form >
<apex:pageBlock >
<Apex:pageBlockSection title="Main Details" columns="2">
<apex:inputField value="{!Custom_object__c.name}"/>
<apex:inputField value="{!Custom_object__c.Buyer__c}"/>
</Apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:tab>
<apex:tab label="tab 2" name="Tab2" id="tab2">
<apex:form >
<apex:pageBlock title="Tab 2 deytails">
<Apex:pageBlockSection title="Details" columns="2">
<apex:inputField value="{!Custom_object__c.Bank_Account_Name__c}"/>
<apex:inputField value="{!Custom_object__c.Bank_Account_Number__c}"/>
</Apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:tab>
</apex:tabPanel>
</apex:page>
Im recently developing a form using VF pages and with tabbed interface. I noticed that eventhough I have included the SwitchType property to client on my tabpanel, i couldn't navigate among tabs.
But when i set either the sidebar or showHeader properties to false on the Apex:page, I was able to navigate among tabs. It was realy frustating and not what i wanted at all. Please kindly help me on this. Here is my VF code.
<apex:page standardController="Custom_object__c" showHeader="true" sidebar="true" id="thePage" tabStyle="Custom_object__c">
<apex:sectionHeader title="Test" subtitle="Test"/>
<style>
.activeTab {background-color: #236FBD; color:white;
background-image:none}
.inactiveTab { background-color: lightgrey; color:black;
background-image:none}
</style>
<apex:tabPanel switchType="client" id="TabPanel" selectedTab="tabMain" inactiveTabClass="inactiveTab" activeTabClass="activeTab">
<apex:tab label="Main" name="MainTab" id="tabMain">
<apex:form >
<apex:pageBlock >
<Apex:pageBlockSection title="Main Details" columns="2">
<apex:inputField value="{!Custom_object__c.name}"/>
<apex:inputField value="{!Custom_object__c.Buyer__c}"/>
</Apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:tab>
<apex:tab label="tab 2" name="Tab2" id="tab2">
<apex:form >
<apex:pageBlock title="Tab 2 deytails">
<Apex:pageBlockSection title="Details" columns="2">
<apex:inputField value="{!Custom_object__c.Bank_Account_Name__c}"/>
<apex:inputField value="{!Custom_object__c.Bank_Account_Number__c}"/>
</Apex:pageBlockSection>
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="Save"/>
</apex:pageBlockButtons>
</apex:pageBlock>
</apex:form>
</apex:tab>
</apex:tabPanel>
</apex:page>
I was searching for the issue you mentioned and found the following solution on the thread -
Use the "value" attribute on the TabPanel component to fix the issue where you are not able to select tab when ShowHeader is true.
read more on the thread:
https://developer.salesforce.com/forums?id=906F0000000957wIAA
Let me know if this helps!