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
Chang Yea MoonChang Yea Moon 

how to programmatically set visual force properties

Hey there, 

Is there a way to programmactically set these properties in my .page file? User-added image

 

For example I want to auto-enable `Show scrollbars` when someone adds this page. Or I want this page to always be 700px. etc

 

my .page file looks like the following format

 

<apex:page sidebar="false" standardController="something" showHeader="false" standardStyleSheets="false" extensions="more something">
    <div id="root"/>
        <apex:includeScript loadOnReady="true" value="{!$somethingscript}"/>
</apex:page>
VinayVinay (Salesforce Developers) 
Hi Chang,

Below below links that can help you.

http://salesforcehacks.blogspot.com/2014/12/resizing-embedded-vf.html
https://salesforce.stackexchange.com/questions/46200/dynamically-resize-visualforce-section-in-page-layout
https://salesforce.stackexchange.com/questions/30605/how-to-create-visualforce-page-with-iframe-with-auto-resizing-height

Thanks,
Vinay Kumar
Chang Yea MoonChang Yea Moon
Hi Vinay,

Thanks for the quick response!

regarding the links: 
The 1st link is outdated and no longer a viable solution. 
The 2nd link seems close. Maybe because its outdated, I can't seem to get it working. Adding an <apex:detail /> is endlessy adding a new VF Page to my page
The 3rd link doesn't seem to be what I want, it is about adding a new iframe and not changing the existing one
Dushyant SonwarDushyant Sonwar
<apex:page sidebar="false" standardController="something" showHeader="false" standardStyleSheets="false" extensions="more something">
<div id="mainDiv" style="height:700px;overflow:scroll;">

    <div id="root"/>
        <apex:includeScript loadOnReady="true" value="{!$somethingscript}"/>

</div>
</apex:page>


Put everything under mainDiv.

 

There is no way you can set these values as it creates an iframe when embedding another vf page. You may try the above but i don't think this is possible.