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
arasuarasu 

How can I disable the inner scrollbars(horizontal and vertical) for the S-Control page.?

Hi,
 
I am working on an S-Control, but by default it seems to have an inner scroll-bar (excluding the browser scroll bars). How can I disable the inner scrollbars(horizontal and vertical) for the S-Control page.
 
Appreciate any feedback on this, since the user will have to control 4 scrolbars to navigate the page.
 
Thanks and regards,
Ambili
Ron HessRon Hess
is the control in a page layout? or tab?
you can set the scroll properties in the page layout , by editing properties on that scontrol (from the edit page layout screen)
arasuarasu
Hi Ron,
 
Thank for the response...The S-Control is in a new Custom Tab, so how can I disable the scrollbars?
 
Thanks,
Ambili
hemmhemm
You can't totally get rid of them as far as I know.  Salesforce puts your tab content into an IFRAME and it needs to specify a height when the IFRAME is set.  The best you can do is max out the Custom Tab height value (9999) and deal with a very long page, but no scroll bars.  If the content in the tab is predictable, you can figure out a height that works for you.  Once the content goes past the height, a second scroll bar appears.

Salesforce even had to use this workaround in their Salesforce for Google Adwords product.  They set the tab height to 6000 pixels for the same reason.

Try voting on this idea of mine.  It's gotten no attention, but it's a request to fix the height issue.

Let me know if you can figure out a different way.
Greg HGreg H

The iframe on the parent tab has an ID of "itarget" so you can call that id from your sControl and then resize the frame based upon the resulting size of your sControl.  The specific function is below:

Code:

//resizes the frame holding the sControl to make up for odd dimensions
function resizeFrame() {
 var sframe = parent.document.getElementById("itarget");
 sframe.style.height = document.body.scrollHeight+"px";
}

You'll need to call this function only after all the other code you are executing in your sControl is finished.

I use this all the time and it is much cleaner than any other option I've tried in the past.
-greg

hemmhemm
Great tip, Greg.  Quick question before I go trying this myself.

Will this work on custom tabs that reference a URL outside the Salesforce.com domain?  I believe the answer is no because the browser will not let another domain's script affect the parent page, but I thought I'd check with you to see if you've dealt with that before.

Thanks.
Greg HGreg H
I agree with you and believe this will not work for remote URLs inside the iframe of a salesforce page.  However, I have not actually tested it.
-greg
sfdcfoxsfdcfox
In your s-control, include this snippet in your "head" tag:
 
Code:
<style>
body
{ overflow: hidden;
}
</style>

Your S-Control will then not display it's own scrollbars. Of course, the main Salesforce page will likely have a scrollbar, but the S-Control itself should not. Be careful not to make your content too large, or it won't be easily accessible to your users.
 
~ sfdcfox ~ 
DPFrazierDPFrazier
When using the method used by Salesforce for Google AdWords (i.e., making the page dimensions very large), the inner scroll bars do show up, you just won't see then in normal operation unless you scroll to the bottom of the page.