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
SkyBlue2007SkyBlue2007 

How to use private Variables from Visualforce.

Hi all,

 

I'll try to use private Variables from Visualforce, but it doesn't work.

 

Here is VF.

<apex:page controller="TestController" action="{!tabTest}" sidebar="false">
<apex:iframe src="{!iframeUrl}" scrolling="true"/>
</apex:page>

 

Here is Controller.

public class TestController {
   private String iframeUrl {get; set;}

   public PageReference tabTest() {
      iframeUrl = 'http://www.test12345.com';
      return null;
   }
}

Please let me know if you have any information.

 

Thanks,

SkyBlue2007

Best Answer chosen by Admin (Salesforce Developers) 
Ankit AroraAnkit Arora

You can not use private variables on visualforce page. Variable should be public and should have get set defined, only after that you can use them on page.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

All Answers

Ankit AroraAnkit Arora

You can not use private variables on visualforce page. Variable should be public and should have get set defined, only after that you can use them on page.

 

Thanks

Ankit Arora

Blog | Facebook | Blog Page

This was selected as the best answer
SkyBlue2007SkyBlue2007

Hi Ankit_Arora,

 

Thank you for your prompt reply.

I understood wha you said.

 

Thanks,

SkyBlue2007