+ Start a Discussion
Sure@DreamSure@Dream 

setting apex:tabpanel height in iframe

Hi All,

I am having a visualforce page, with a tabpanel component.
<apex:tabpanel switchType="client">
    <apex:tab name="tab1" onTabEnter="parent.setHeight(window);">
     ----------some content------
    </apex:tab>
     <apex:tab name="tab2" onTabEnter="parent.setHeight(window);">
     ----------some other content------
   </apex:tab>
</apex:tabpanel>
First tab will be having content of 1600 px height and second tab content will be having 400px height.

I am displaying this visualforce page in another vf page using an iframe.
I am setting the height of the iframe dynamically onload of the iframe, using the following javascript function.
   function setHeight(obj)
   {
        obj.style.height=obj.contentWindow.document.body.scrollHeight+'px';
    }
   ................
  <apex:iframe html-oncomplete="setHeight(this)" scrolling="false"/>


But when I click on any tab, in the iframe the parent method are not getting called.
Even I am not able to switch the tabs.

In the debug console, its showing an error like following:
"XMLHttpRequest cannot load ..... No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '.....' is therefore not allowed access"


Can someone help me with this please?
I want to reduce the height of iframe, when the tab switching is happening, so that for the second tab more space wont be shown.

Thanks