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
William NgWilliam Ng 

Visualforce auto height

Hi all,

I have question on Visualforce page embeded in detail page. My content on the VF page is dynamic, so I can't have a fixed height of the frame. What is the proper way to implement auto resize the iframe for VF? It would be great if someone here can point me to the right direction. Thanks.
RohRoh
Hello William,
Salesforce OOB provides you with the adjustments.
Go to edit layout of your detail page, 
Click on properties of your inline VF page, there you could select the below properties.
User-added image

PLEASE SELECT THIS AS THE BEST ANSWER, IF YOU LIKE IT.

Thanks,
Rohit Alladi
jyothsna reddy 5jyothsna reddy 5
Hi William,
 
 
<apex:page> <div id="my-timeline" style="height:300px; border: 1px solid #aaa"></div> </apex:page>

 any apex:outputPanel or DIV can take a height attribute like this one, many other components also accept style cssstyle or height attributes.

Hop it helps,

Regards,
Jyothsna D
 
William NgWilliam Ng
I am sorry that I wasn't making myself clear. Let me try again. We have a canvas app that was embedded in page layout which support auto resize. Everything was ok until Ligitning was introduced. Everything is running fine in Classic, but when switch to Lightning, the canvas app doesn't reload (causing error) after Edit (something to do with partial reload I suspect). I can avoid/fix the problem by putting the canvas app inside a VF page. However the iframe that generated by salesforce (Lightning/Classic) doesn't auto resize the height.

I tried to use the cross-domain iframe script method, it kinda works with Classic mode, but I still run into a little problem with Lightning (since they changed the domain name when you switch between Classic and Lightning)

Any ideas? Thanks.

William
William NgWilliam Ng
Can anyone shine some light to my problem? Thanks.

William
Marco FantiMarco Fanti
Hi William,
I'm struggling with the same problem here, have you figured out how to adjust the height of the VF page?
Emily PhillipsEmily Phillips
I'm looking for an answer to this problem as well. I need the Visualforce Page Component container to be responsive to its contents.