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
Deepak PansariDeepak Pansari 

Onclick event is not working gwith <apex:Tab>

Hi All,

 

I have below test Visualforce page , in which i am trying to call onclick event for tab but it not working.

 

Can someone help me ..

 

code//

 

 

<apex:page standardController="Account" ><head> <script language="javascript"> function setfirst() { alert("first"); } function setsecond() { alert("second"); } </script></head> <apex:tabPanel switchType="client" selectedTab="tabdetails" id="tabPanel"> <apex:tab label="General" name="General" id="tabGeneral" onclick="setfirst()"> </apex:tab> <apex:tab label="Professional" name="Professional" id="tabProfessional" onclick="setsecond()"> </apex:tab> </apex:tabPanel></apex:page>

 

Regards,

Deepak 

 

 

JimRaeJimRae

I think it works, just not the way you might want it to.

I implemented your code snippet, and when I click on the Tab itself (where the label is rendered) nothing happens.  But, when I click on the tab body (the area below the tab label), the alert is displayed.

Not sure why that is, or how to get your desired result, but wanted to provide an update.

 

rocky_finrocky_fin

I am also facing the same problem....can anyone tell me is there any work around for this......

when i am trying to click on tab nothing is happening but on click of tabarea desired fuctionalty is working

sforce2009sforce2009

You have to use onTabEnter instead of onClick

Prad47Prad47

I was facing same issue but it resolved with onTabEnter.

Thanks all 

krishna2610krishna2610

TabEntre attribute is not supported in <apex:tab>.pls let me know how to use it.

Prad47Prad47
  I used "ontabenter" event to call javascript function Ex <apex:tab label="Projects" name="projectTab" id="projectTab" ontabenter="ShowAlert();"/>

Thanks