+ Start a Discussion
IT Admin DeloitteIT Admin Deloitte 

​onclick method on custom visualforce tabs

Hi All,

in a VF page I create 5 custom tabs, called Orders, Orders II,...etc

<apex:tab label="Orders" name="OrderDetails" id="tabdetails">
smt in here
<apex:tab/>

I want click on Order II tab and visualize the corresponding content, in the same page.
Now the VF shows correctly the tabs, but I can't click on them. I can only visualize the first tab.
Is there a sort of onclick method that I have to implement?
How it should be composed and then called in the vf page?

Thankyou!!
Best Answer chosen by IT Admin Deloitte
Nirmala  KuchiNirmala Kuchi
I believe there must be some part of code which is confilicting with tabs functionality.. as simple tabs are working fine.. Hope this link may help..http://salesforce.stackexchange.com/questions/21207/tab-panel-error

All Answers

Sagar PareekSagar Pareek
This might help you
https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_tabPanel.htm
IT Admin DeloitteIT Admin Deloitte
I used that example to implement my tabs, but with that code I cannot click on the created tabs.
 
Nirmala  KuchiNirmala Kuchi

The <apex:tab> component must be a child of a <apex:tabPanel>.

Following markup worked for me.. I think onclick event is not required here to switch between the tabs..

However, if required onclick attribute is still available..

​<apex:page id="thePage">
    <apex:tabPanel switchType="client" selectedTab="name2" id="theTabPanel">
        <apex:tab label="Orders 1" name="name1" id="tabOne">content from Orders 1</apex:tab>
        <apex:tab label="Orders 2" name="name2" id="tabTwo">content from Orders 2</apex:tab>
    </apex:tabPanel>
</apex:page>

IT Admin DeloitteIT Admin Deloitte
So why I can't switch among tabs? It's like I cannot even select them.
I implemented it as specified in the previous link.

 
Nirmala  KuchiNirmala Kuchi
I believe there must be some part of code which is confilicting with tabs functionality.. as simple tabs are working fine.. Hope this link may help..http://salesforce.stackexchange.com/questions/21207/tab-panel-error
This was selected as the best answer
IT Admin DeloitteIT Admin Deloitte
I used this script as suggested in the link and everything was ok. Thank you.

<script type="text/javascript" language="javascript"> if(jQuery) { jQuery.noConflict(); } </script>