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

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">





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?



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



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





function twistSection(twisty, sectionId) {

//twistSection code from

var parentDiv = twisty;

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

var headerId = sectionId || ('_'))[1];

var div = parentDiv.nextSibling;

var elemWasOn = false;

if ( != 'none')

{ = 'none';

twisty.className ='showListButton';

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

elemWasOn = true;



{ = 'block';

twisty.className ='showListButton';

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

elemWasOn = false;







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