0

I have a VF Page referencing a VF Component to display a PDF attached to a Record. Both Page and Component are part of a managed package. The Page is included in the standard layout of the record to display the PDF there.

The Problem is the PDF Height in the standard layout is too small. I want to increase the Height so it is easier to read.

The VF Component gets the height as a parameter called "max" from the Page. Sadly the component is not global so i can't make a custom page referencing the component. Instead my approach was creating a custom page, including the managed page and change the Parameter there.

This would be my Custom Page:

    <apex:page standardController="myObject__c" showHeader="false" sidebar="false">
        <apex:iframe src="/apex/myManagedPage?id={!myObject__c.Id}&max=1000"/>
    </page>

And this is the Managed Page:

<apex:page standardController="myObject__c" showHeader="false" sidebar="false">
    <c:myManagedComponent objectId="{!myObject__c.id}" maxHeight="{! IF(!isBlank($CurrentPage.parameters.max),$CurrentPage.parameters.max,'500')}"/>   
</apex:page>

Thanks in advance.

1 Answer 1

1

You can pass the parameters you desired with iframe via source attribute.

I can help you to do that if this solution is ok for your case.

        <apex:iframe src="yourDomain/apex/YourPagename?max=2000" />

This will execute your other pages's controller and pass parameter(s) to your component. But it will behave as a different page on the same screen.

For further information https://developer.salesforce.com/docs/atlas.en-us.pages.meta/pages/pages_compref_iframe.htm

Can you also write your use case so maybe I can suggest you a better solution.

2
  • 1
    Thanks for the help.Can you maybe provide a basic example for this? Nov 9, 2016 at 12:32
  • Well i edited my question. Even using iframe the height if the PDF is still the same size. Since i can't see what happens inside the component, i can't be sure the parameter "maxHeight" gets processed properly. Thank you anyways for your help. This would have otherwise done the trick. Nov 9, 2016 at 13:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .