0

Here is a basic code of what I am trying to do:

<apex:page>
    <apex:pageBlock >
        <apex:iframe src="CannotFigureOut" scrolling="true" id="theIframe"/>
    </apex:pageBlock>
</apex:page>

If I simply hard code in a URL in place of CannotFigureOut the iFrame works the way I want it to. However, I want to reference a URL Field I have on the Page/Custom Object I am in.

I have a custom object where a user can input a unique URL when they create it and/or whenever they want. I want the iFrame/VisualForce Page to show the URL from that field.

I am sure the answer is simple, but I cannot figure it out.

1 Answer 1

1

First, you need a standard controller to get access to the URL field. Next, you just need to reference it like a normal expression. Here's your example, modified:

<apex:page standardController="Account">
    <apex:pageBlock >
        <apex:iframe src="{!Account.Website}" scrolling="true" id="theIframe"/>
    </apex:pageBlock>
</apex:page>

Replace "Account" and "Website" with the appropriate object and field name.

You must log in to answer this question.

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