What prevents reRendering of the whole Visualforce Page when changing between ?

697    Asked by PavithraShah in Salesforce , Asked on Aug 22, 2021

in my Visualforce page I have created an apex:pageblock that consists of an apex:selectList for sorting and an apex:tabPanel (Leads & Accounts)

enter image description here

Now when I switch between these tabs the entire visualforce page reloads which includes a google map. This not what I want and at the same time can't figure out why this is happening. What 'action' tells the page to reRender when switching tabs?

I only want the pageblock to reRender. This behaviour is fine when I change the value of the 'selectList' element in order to sort the records inside the tabs.

Here is the code that handles the pageblock:

  sortieren nach:        <!-- TAB LEADS -->    
<style type="text/css"> .col1 {width:5px; text-align:left;} .col2 {width:400px; text-align:left;} </style>
<!-- Jump to location and highlight --> <!-- Distanz --> {!distances[war.id]} <!-- Anzahl Anzeigen --> {!war.AD_MS_Rel_Anzahl_bez__c} Anzeigen <!-- Branche -->
<!-- Jump to location and highlight --> <!-- Distanz --> {!distances[pote.id]} <!-- Anzahl Anzeigen --> {!pote.AD_MS_Rel_Anzahl_bez__c} Anzeigen <!-- Branche -->
Answered by Emma Lewis

apex:tabPanel > Attributes... switchType · String · The implementation method for switching between tabs. Possible values include "client", "server", and "ajax". If not specified, this value defaults to "server".

As you don't specify anything, it is set to server, which means that it is salesforce the one re-rendering everything going back and forth. If you use client, the whole switch would be in Javascript and the information would be kept (tabs are loaded and just hidden using CSS and by doing so, keeping all information you have inside.)

...

Note: You sould be careful if you have required inputs / validations spread around the different tabs.

Additional :What is the use of tab in Salesforce?

The component is a child of a .This component supports HTML pass-through attributes using the "html-" prefix. Pass-through attributes are attached to the generated tag that wraps the tab's contents.



Your Answer

Interviews

Parent Categories