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
guest1231231guest1231231 

Only Load Tab When...

With apex:tabpanel is there a way to only "load" a tab when the user clicks that tab?  For example, a tab displays an external website using iframe, but I only want that external website to load when the user actually clicks on the tab.

 

Is this possible?

 

Here is one such code snippet I only want to load when the user actually clicks the tab.

<apex:tab label="Website" name="Website" id="website">
<iframe width="100%" height="500" frameborder="true" scrolling="true"
src="http://{!Account.Website}">
</iframe>
</apex:tab>

 

 

 

-Thanks

Pradeep_NavatarPradeep_Navatar

Set the “rendered” property of <apex:iframe> to false and on the “on Click” event set this property to true.

 

Hope this helps.

guest1231231guest1231231

Like this?

 

 

<apex:tab label="Website" name="Website" id="website" >
  <iframe width="100%" height="500" frameborder="true" scrolling="true" marginheight="100%" marginwidth="100%" rendered="false" 
  onclick="src="http://{!Account.Website}"" >
  </iframe>
</apex:tab>