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
rebvijkumrebvijkum 

How to Refresh the tab in visualforce when i click the tab again?

I have created a tabpanel with 13tabs in it. when i click on a tab it opens an article.
Now i want to refresh the tab back to default when ever i click on the tab again.

Any help greatly appreciated
Best Answer chosen by rebvijkum
rebvijkumrebvijkum
used ontabenter attribute on
<apex:tab label="Eligibility" name="Eligibility" id="tab2" ontabenter="refreshEligi()">
<apex:actionFunction name="refreshEligi" action="{!setRefreshEligiFlag}" status="LoadingStatus2" immediate="true" rerender="eligibilitypanel"/>
<apex:actionStatus startText="Loading..." id="LoadingStatus2"/>
<apex:tab/>

on controller:
public pagereference setRefreshEligiFlag() {

        Eligiframeflag = true;           
        Eligiartresflag = false;
        Eligiframedetailflag=true;
        return null;
       
    }

All Answers

Sagar PareekSagar Pareek
Hi Rebbala,

You can use apex:tab 's  reRender  attribute to refresh the tab back to default content.

<apex:tab label="One" name="name1" id="tabOne" reRender="tabOne">content for tab one</apex:tab>


rebvijkumrebvijkum
it doesn't help

Subramani_SFDCSubramani_SFDC
you have any custom controller for this ??
rebvijkumrebvijkum
Yes i have a controller.

Every Tab has two columns one is 80%width left and another 20%width right .
Column one has an iframe which opens an article and
Column Two which is a sidebar has an inputtext & commandButton to search articles and the results are shown in column one within iframe.

so the problem is wen i click tab again it should show the article again?
Hope you understand the problem. The codes are huge, let me knw if u need them
rebvijkumrebvijkum
used ontabenter attribute on
<apex:tab label="Eligibility" name="Eligibility" id="tab2" ontabenter="refreshEligi()">
<apex:actionFunction name="refreshEligi" action="{!setRefreshEligiFlag}" status="LoadingStatus2" immediate="true" rerender="eligibilitypanel"/>
<apex:actionStatus startText="Loading..." id="LoadingStatus2"/>
<apex:tab/>

on controller:
public pagereference setRefreshEligiFlag() {

        Eligiframeflag = true;           
        Eligiartresflag = false;
        Eligiframedetailflag=true;
        return null;
       
    }
This was selected as the best answer
Ravi KothariRavi Kothari
Will this solution work for the lightning tabs as well ?