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
MyGodItsColdMyGodItsCold 

twistSection and <apex:detail> - OK if Object not yet seen - sticky section collapse setting?

When a user goes to a page, say an Account detail page, and makes some changes to the open or closed twisty on a section, does that setting stick for a user?

I have a VF page which includes some javascript code, including the call to the twistSection function. This page also includes:

<apex:detail>

If I have not viewed an Account record, things behave as I would expect. (The sections I ask to be collapsed, are).

However, if I have previously viewed the record, things do not behave as I would expect. (Some sections collapse, some not - and I'm having trouble noting the pattern, however I confess I have not applied systematic trial and error).

If the Twisty settings are sticky, what are the rules?

Is there any other mechanism at play which might give me what I'm observing?

 

Additional detail: I'm looking at a rendered page's iframe source to get the ID of the h3 I need. Thus, my twistSection call (in my <script> tags) looks like:

 

twistSection(document.getElementById('head_01B50000002HqNn_ep_j_id0_j_id3').getElementsByTagName('img')[0]);

 

I'm also defining checkboxes on the User record to let users decide how much clutter they want - but I doubt that is playing a role in what's happening (I wouldn't mind being wrong on this if it leads me to a solution or an understanding that something else is blocking me).

 

 

Tia,

 

MyGodItsColdMyGodItsCold

A closer read of the source was helpful. It looks like there are cookies (not sure) somehow involved - but what I found that works is to test the class of the img. We put checkboxes on the User record for each section's default: closed/open. Then depending upon what the class says the state of the img is in, we either twistSection - or not.

 

Javascript + <apex:detail> + override

 

When SFDC builds this in, we'll re-evaluate.