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
Scooter429Scooter429 

Is it possible to use Visualforce with a managed controller?

I appreciate that for the moment it is not possible to package Visualforce pages. 

1.  Can you confirm that it is possible to use a packaged controller with a Visualforce page?

2.  Assuming the answer to question 1 is yes, then how would I modify this simply mark-up to call a managed package with a namespace prefix of ABCD?

Code:
public class Test {
String result='Click here!!';
public String getData() {
return result;
}
}

<apex:page controller="ABCD__Test">
<apex:form >
This is the test page.
{!Data}
</apex:form>
</apex:page>

3.  Absent the ability to package a VF page what is the best practice to secure a Page from inadvertent change?  It looked like disabling the "Author Apex" permission for a given profile would lock down the markup.
ESES
It is possible to use packaged controller with a visualforce page.

However, if the "Namespace prefix" of the controller and the page is not the same (for example, if you have installed a managed package from Org-A containing the controller to Org-B) Visualforce page in Org-B will not be able to access classes/methods that are "public" (only "global" classes/methods can be accessed from a different namespace - see apex dev-guide for details).   

Profiles with "Customize Application" permission can edit the markup of a page by going to the setup.
md1md1
We have the same issue - we need to package our application for multiple clients but do not want to share the source.

Could you/someone be a little more clear on this? Until VF becomes 'packageable', we just need a simple way to ensure that the pages that we create will work with the controllers within our AppExchange Package before we try to build these.

Rephrasing the above questions....

1. If we package the code (controllers) as a managed package and then provide the pages separately, we want to be sure that they will work as expected.

2. Does removing the 'Customize Application' permission impact other permissions? We can't remove it for the admin users, can we? What are the impacts here.

Or should we ideally just wait for VF pages to become 'packageable'???