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
yogesh.rankawatyogesh.rankawat 

inline visualforce page not rendered correctly in IE

Hi

I have added inline visualforce page to Lead details page.
It rendered correctly in Firefox. But in IE some time it is not rendered, even after refreshing the page.

Any idea .... :smileyhappy:
Ron HessRon Hess
are you using the supported version of IE?

does this occur when your browser is in development mode?

what sort of error?
not rendered implies that you get a white area in the browser, is it the correct size?
yogesh.rankawatyogesh.rankawat
I am using IE6 and development mode is off.

I am using following function to resize the iframe

  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";
      }
    }
  }


But some time inline visualforce is not rendered means iframe size is 0px.

Ron HessRon Hess
if you remove the resize(), does it work (display) correctly each time ?
yogesh.rankawatyogesh.rankawat
Yes it works, if we remove this function.
But its a standard function that I copied from salesforce to resize the iframe.
Any alternate solution to resize iframe according to height of visualforce page ?

Ron HessRon Hess
I don't know why that javascript would cause a visualforce page to render incorrectly in IE, but i'm pretty sure that the resize() function is not part of Visualforce feature set even if you do find it used elsewhere on the detail page.
JohanLiljegrenJohanLiljegren
I've experienced intermittent problems with IE6 and the resizeIframe() function found throughout the forums. Instead, I've hardcoded a value to use when that happens. It's not pretty, but it works.

Here's my version of resizeIframe()
Code:
function resizeIframe() {
    //This function resizes the iframe to the size of the s-control
    var thisWindow = window.name;
    if(thisWindow){
        var iframes = parent.document.getElementsByName(thisWindow);
        if (iframes && iframes.length == 1) {
            var height = document.body.scrollHeight;
            var width = document.body.scrollWidth;
            if ( height + width == 0 ) {
                //This seems to happen at times with IE
                height = 18;
                width = 145;
            }
            iframes[0].style.height = height + "px";
            iframes[0].style.width = width + "px";
        }
    }
}