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
Lewis ReedLewis Reed 

Is it possible to load data into a tab panel only for the active tab?

Is it possible to load data into a tab panel only for the active tab?

I have multiple tabs on one of my pages, embedded with the <apex:tabpanel>

As these are quite large and loading times are slow, is it possible to only load the data from the methods on the current tab panel as oppose to all of them?

Thanks in advance 
RohRoh
Hello Lewis,
I am guessing you built this tab page using js and jquery .
In that case, on page load the entire data will be captured from server onto the client and thereby affecting your view state also.
Instead i would go with an approach where you could break your tabs into respective pages, and on click of each tab navigate the user to the required page.
This way , the view state is controlled and also large data query will also be prevented.

Thanks,
Rohit
souvik9086souvik9086
Try to use separate methods for each tab and rerender only the active tab and bring your data from that method. Use boolean variables for each tab and check true/false in rendered condition in vf.
Vishal Negandhi 16Vishal Negandhi 16
I believe currently, when you load the page which has multiple tabs you set up entire data in controller and bring it down on the page. Only to show/hide them based on which tab is seen (active). 
You can instead load data only for active tab when the page loads first and then for every change on tab, use the onclick event on apex:tab and get the data. So at one point of time you only have data for one tab.