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
ShikibuShikibu 

twistSection is not defined (javascript error for pageBlockSection)

Why do I get "twistSection is not defined" javascript errors for the following use of pageBlockSection?

 

 

<apex:page standardController="Account" extensions="OEMTeamReportController" showHeader="true" tabStyle="account" standardStylesheets="true" title="OEM Services Team Resources"> <apex:form > <apex:pageBlock title="OEM Opportunities for Review"> <apex:repeat value="{!accounts}" var="this_account"> <apex:pageBlockSection title="{!this_account.acct.Name}" columns="1" collapsible="true">

<table class="opps_table">
etc...

 

 

 

CloudMikeCloudMike

I'm getting the same problem also.  It appears to be working on one page and not another.  I'm unable to locate the problem. 

 

Shikibu - have you found the solution to this issue yet?

 

 

ShikibuShikibu
No, I did not find a resolution.
Benjamin Pirih.ax1481Benjamin Pirih.ax1481

Greeting,

 

If you add the following script section to the page it will work properly.  Not sure why the sf.com script is not loading correctly..

 

<head>

 

<script>

function twistSection(twisty, sectionId) {

//twistSection code from salesforce.com

var parentDiv = twisty;

while (parentDiv.tagName != 'DIV') { parentDiv = parentDiv.parentNode; }

var headerId = sectionId || (parentDiv.id.split('_'))[1];

var div = parentDiv.nextSibling;

var elemWasOn = false;

if (div.style.display != 'none')

{

div.style.display = 'none';

twisty.className ='showListButton';

twisty.alt = twisty.title = 'Show Section - '+twisty.name;

elemWasOn = true;

}

else

{

div.style.display = 'block';

twisty.className ='showListButton';

twisty.alt = twisty.title = 'Show Section - '+twisty.name;

elemWasOn = false;

}

}

 

</script>

 

</head>

Daniel BallingerDaniel Ballinger

I found another possible workaround. Inject a fake pageBlockSection immediately after the wrapping pageBlock. This forced Salesforce to inject the missing twistSection function.

 

See apex:pageBlockSectionItem collaspe or expand throws “twistSection is not defined” JavaScript exception