You need to sign in to do that
Don't have an account?

Problem accessing attribute in VF page in Sites after packaging
Hi everyone,
We have a weird problem: After packaging, and whatever type of package we use to do so, the VF page in Sites doesn't retrieve values that has been fetched in the controller.
It ONLY happens in Sites. We have used the same page from the private url and it works. In the packaging org it works on both side.
So it's definitely a Site issue after packaging.
We tried with a unmanaged package to try and debug. But everything seems to happen ok: the controller is called, the SOQL request gets the values, no exception is sent. But in the VF page there is nothing in place of what should be displayed.
Here is a simple example:
public class cont { public String color {get;set;} public cont(){ color = [select color__c from Color__c limit 1].color__c; } } VF page:<apex:page controller="cont">Color:{!color} </apex:page>
No exception is thrown but the color is not displayed if we use this in Site after packaging the application and install it to a DE org.
Probably linked to this problem we can't access the page aymore. We need to prefix it with the package prefix manually. By example:
http://oooooooooooooo-developer-edition.na6.force.com/default?foconfig=carreer
http://oooooooooooooo-developer-edition.na6.force.com/EosTrial98__default?foconfig=carreer
works.
We also noticed that the prefixed pages look a bit weird:
<apex:page controller="EosTrial98.FrontOfficeConfigExt" showHeader="false"><apex:composition template="EosTrial98__CareerSiteTemplate">
Isn't it supposed to be a . and not __ ?
Our direct conclusion is that everything is linked in a way. Also it seems that we started to ave these problems since middle of last week.
Any idea?
Laurent
Here is the latest on this. We closed the bug, because this is working how it;s supposed to be and here is why:
When you reference a page within a package you need to qualify the name space. there could be several other pages with the same name coming from different packages or you might have create one directly. If you don't specify the page with the name space then system wouldn't know which page is getting referenced.
here are the correct ways to refer to page "mypage" within package namespace "ns".
In VF page: $Page.ns__mypage
In Apex code: Page.ns__mypage
you need to use this regardless of site use case. When you are logged in to salesforce system changes the domain name and keeps the page name clean.
But in site context since we do not want to change the branded domain name page name will include the name spece as well like following:
In URL: http://mydomainname.force.com/ns__mypage
All Answers
Here is the latest on this. We closed the bug, because this is working how it;s supposed to be and here is why:
When you reference a page within a package you need to qualify the name space. there could be several other pages with the same name coming from different packages or you might have create one directly. If you don't specify the page with the name space then system wouldn't know which page is getting referenced.
here are the correct ways to refer to page "mypage" within package namespace "ns".
In VF page: $Page.ns__mypage
In Apex code: Page.ns__mypage
you need to use this regardless of site use case. When you are logged in to salesforce system changes the domain name and keeps the page name clean.
But in site context since we do not want to change the branded domain name page name will include the name spece as well like following:
In URL: http://mydomainname.force.com/ns__mypage
And we checked all the security settings and profile.
And as I said previously this exact same page works in a normal org with Site but not in a org we installed the package to so I think it is definitely something between package install and Site.
Thanks,
Laurent
Can you provide the url for the site this is working fine?
So I can compare pubic access settings of both sites
The org we packaged from:
http://powdugpofvopevewj-developer-edition.na6.force.com/apex/default?foconfig=Test
-> works fine
The org we packaged to->
http://assdasdasdasdzcx-developer-edition.na6.force.com/apex/default?foconfig=carreer
-> doesnt display the data in the VF page. (but get them from SOQL request)
One important precision.
This last one is an org we installed an UNMANAGED package. This way we can assure the SOQL worked good. This is why I can assume the public profiles and security settings are alright.
It also means this is related to neither the type of the package nor the prefix thing as an unmanage package doesn't put any prefix. Am I right?
Cheers,
Laurent
Laurent,
custom object in this org are not in "deployed" status. In order to site to display data from these objects they need to be deployed.
Thank you very much it owrks.
I have never heard of that before but indeed this was the problem.
Thank you again.
Laurent