All you should need is an a4j:jsFunction with the correct action parameters and to use something like:
<rich:tab ontabenter="jsEnterFuncName();" onclick="jsClickFuncName();" ontableave="jsLeaveFuncName();">
if your tab panel switch type = server or ajax - just use corresponding tab attributes action and actionListener. Or valueChangeListener for tabPanel itself. You should not duplicate this built in functionalyti with supports because duplicated submits will be risen in this case.
If you use client side tab panel - then yes you could use supports or jsFunctions but why then you need client side switch type? ;)
Minor. B.t.w. ontabchange - event of tabPanel but not a tab event.
If you are using the ontabchange event, is there a way to get the name of the tab that has been selected?
I see that it is in the event but I'm not sure how to access it.
you could use valueChangeListener on tabPanel. And invoke the request with support pointed to this event without any action. So in the valuechangelistener you'll be able to get source of the event.
Hi Ilya Shaikovsky,
I am a great fan of your works. I find your solutions very usefull when i can't find a work-around.
As my problem is related to <rich:tab> so i am posting my issue here, sorry if i have done anything wrong. I am a new guy in this community. Hope you guys won't mind.
It is clear that onclick attribute is present for rich:tab (http://docs.jboss.org/richfaces/latest_3_3_X/en/tlddoc/rich/tab.html). But it is not working for me. Infact i have also tried oncomplete, ontabentered, onlabelclick.
The switchType for rich:tabPanel is "client".
It would be a great help if you give me any solution. Thanks in advance.
Sorry i was using Richface 4.1.0.CR1. So the reference link i provided on the last post should be (http://docs.jboss.org/richfaces/4.1.X/4.1.0.CR1/vdldoc/rich/tab.html). And i have found a solution to my problem using "onenter" (which i believe, is replacement for ontabentered) instead of "onclick". Thank you.