You need to sign in to do that
Don't have an account?
sfdc-apex
how to display a visualforce page in home page whose height should vary dynamically
Hi,
I'm using a visual force page in a home page component.But height remains as I specified and if onlw few records are retrieved blank space is coming up between the components.
I dont want to use scrolling option.So how can I vary the height dynamically based on the number of records.
the html i'm using for my component is below..
<IFRAME id=VisualForceLeads name=VisualForceLeads src="/apex/testLead" frameBorder=0 width="100%" scrolling=no height=1000></IFRAME>
Any pointers regarding this will be of great help.
Thanks in advance..
function resizeIframe () {
var me = window.name;
var height = 0;
if (me) {
var iframes = parent.document.getElementsByName(me);
if (iframes && iframes.length == 1) {
height = document.body.offsetHeight;
if (height > 32768) {
// Maximum iframe height is 32768. Setting any larger value will result in a very large
// parent window height, and still a scrollbar on the iframe itself. The bottom of the window
// will be a huge expanse of blankness. It's pretty ugly.
height = 32768;
}
iframes[0].style.height = height + "px";
}
}
}
:smileyhappy:
Hi,
I tried using this code to make a home page component dynamic but it is not working. Can I get some help with it please?
<IFRAME id=MessageBoard name=MessageBoard src="/apex/MessageBoard" frameBorder=0 width="100%" scrolling=yes height=235>
function resizeIframe () {
var me = window.name;
var height = 0;
if (me) {
var iframes = parent.document.getElementsByName(me);
if (iframes && iframes.length == 1) {
height = document.body.offsetHeight;
if (height > 32768) {
// Maximum iframe height is 32768. Setting any larger value will result in a very large
// parent window height, and still a scrollbar on the iframe itself. The bottom of the window
// will be a huge expanse of blankness. It's pretty ugly.
height = 32768;
}
iframes[0].style.height = height + "px";
}
}
}
</IFRAME>
I got this working with the page
http://stackoverflow.com/questions/10898856/how-do-i-get-my-customer-portal-to-auto-adjust-its-components-size