I have 3 tabs,whenever I click the tab,pageblock has to be refreshed.need your help,thanks in advance.
<apex:page id="pg" standardController="Noise_Dictionary__c" extensions="SynonymsDictionary_cls" tabstyle="Noise_Dictionary__c" >
<script>
function myFunction(){
var query="select id,name from Noise_Dictionary__c";
var records = sforce.connection.query(query);
var records1 = records.getArray('records');
alert(records);
}
</script>
<script type='text/javascript'>
var waitTime = 1;
var countDown = waitTime + 1;
var started = false;
function resetTimer() {
countDown = waitTime + 1;
if (started == false) {
started = true;
runCountDown();
}
}
function runCountDown() {
countDown--;
if (countDown <= 0) {
fetchResults();
started = false;
} else {
window.setTimeout(runCountDown, 1000);
}
}
</script>
<style type="text/css">
.activeTab {
font-size:1.25em;
font-style:normal;
font-family: 'Calibri';
font-weight:bold;
background-color: #3090C7;
color:white;
background-image:none;
border: 2px solid #747e96;
border-bottom: 0px solid #fff;
border-radius: 10em 0 5em 2em;
}
.inactiveTab {
background-color: #EDE3D1;
color: #838483;
background-image: none
border-radius: 10em 0 5em 2em;
}
.exceptionText{
font-style:italic;
font-size:16px;
font-weight:bold;
text-align:center;
<apex:form id="frm">
<apex:tabpanel id="tbp" switchType="client" selectedTab="name1" tabClass="activeTab" inactiveTabClass="inactiveTab" headerAlignment="center">
<apex:tab label="Noise Dictionary" onclick="myFunction(); ">
<apex:pageBlock title="Noise Words Dictionary" id="pb" >
</apex:pageBlock>
</apex:tab>
<apex:tab id="tabId" label="Contact Dictionary" >
<apex:pageBlock title="Contact Dictionary" id="PageB" >
</apex:pageBlock>
</apex:tab>
<apex:tab id="tabIds" label="Account Dictionary" >
<apex:pageBlock title="Account Dictionary" id="PageB1" >
</apex:pageBlock>
</apex:tab>
</apex:tabpanel>
</apex:form>
</apex:page>
Best Answer
Go throught the use of Render and ReRender.for help you can follow the following link -- https://developer.salesforce.com/forums/?id=906F0000000AUDnIAO