Skip to main content

Hello All,

I have found that embedding a visualforce page as an iframe in a component seems to work better than using the standard VisualForce Lightning page component.

 

Any thoughts as to why one would use the VF page standard lightning component vs. embedding the page in a custom component?

 

Advantages

  • The visualforce page label goes away
  • More space is available (screen real estate)
  • Ability to add more outside the page leveraging lightning development
  • Other?

 

Disadvantages

  • Can't open links in parent window without javascript
  • Other?

 

Here is a template what I used to build the simple lightning component that embeds the VF page.

 

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction" access="global" >

    <iframe src="{!'/apex/your_visualforce_page_name_here?Id=' + v.recordId }" width="100%" height="100%" frameBorder="0"/>

</aura:component>

1 comentário
  1. 30 de nov. de 2017, 18:17
    Hey Rick -- the only "benefit" to using the VF component vs. a custom component is the fact that you don't have to "code". But if you are comfortable doing the simple coding that you've done, then I agree it is the better approach.
0/9000