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
SCRSCR 

How to get all column data to display in Sites Page login customer portal user/sites user?

 

Hello all,

 

I am developing a related set of external VisualForce Site Pages, Job Search, Job Detail and New Job Application for a recruiting app.  The Pages functioned as expected when configured as external Sites Pages (without any user authentication).  When I configure them to be accessed via the Customer Portal/Sites with user registration required it fails to render any column data in either the Job Search results except for the first column of data when successfully logged into the site.  The first column of data is the Job Position ID (which is the Position__c.Name field in force.com rendered in VF as an apex:outputLink tag) which is also the Link to the Job Detail record for each item in the list view.  Similarly, even though you can click on the Job Position ID link and get to the Job Detail Page (and record), the only column data that in the result is again the Job Position ID.

 

Results for the Active Site Home Page with Customer Portal/Sites and user registration required

 

There are 6 columns defined in the VF markup for the Job Search Page (VF name: PublicJobs) for the Search Results Page Block Table and all 6 column headers appear across the first row in the following order (bolded headers denote their appearance in the Page):

 

Search Results (Page Block Title)

 

Position ID | Title | Department | Location | Job Description | Position Open Date

    ^

theLink

(the only

column

with data)

 

There are 10 columns defined in the VF markup for the Job Detail Page (VF name: PublicJobDetail) for the Job Detail Page Block Section and only 2 of the 10 appear as headers right aligned under the first column in the following order (bolded headers denote their appearance in the Page):

 

Job Detail (

Information

 

Position ID

Read ONLY TEXT  (the only column with data)

Location City/State/Country

READ ONLY TEXT

Position Type Name

READ ONLY TEXT

Department

READ ONLY TEXT

Start Date

READ ONLY TEXT

Programming Languages

READ ONLY TEXT

Job Description

READ ONLY TEXT

Responsibilities

READ ONLY TEXT

Educational Requirements

READ ONLY TEXT

 

Results for the Active Site Home Page without Customer Portal/Sites

 

All 6 column headers appear across the first row and all of the data expected is rendered (e.g. below)

 

Search Results (Page Block Title)

 

Position ID | Title | Department | Location | Job Description | Position Open Date

 

The expected Data for all columns and all records is returned in the Search Results

 

All 10 columns appear as headers right aligned under the first column and all of the data expected is rendered (e.g. below):

 

Position ID

All Expected Data in READ ONLY TEXT

Location City/State/Country

All Expected Data in READ ONLY TEXT

Position Type Name

All Expected Data in READ ONLY TEXT

Department

All Expected Data in READ ONLY TEXT

Start Date

All Expected Data in READ ONLY TEXT

Programming Languages

All Expected Data in READ ONLY TEXT

Job Description

All Expected Data in READ ONLY TEXT

Responsibilities

All Expected Data in READ ONLY TEXT

Educational Requirements

All Expected Data in READ ONLY TEXT

 

I have checked (and rechecked) the Public Access and other Settings for the Site Pages, as well as the Assigned Profile Settings for the Customer Portal to make sure the Customer Portal User Profile is Assigned and that the Objects are visible in the Customer Portal, etc.  Please see the related VF Sites Pages code below.  Any suggestions or help is greatly appreciated.  I have spent much time trying to figure this out before resorting to this post.  I am a newbie at Sites, so please be gentle.

 

Thanks,

SCR

 

VF and Apex Controller Code

 

PublicJobs VF Markup:

 

<apex:page showheader="false" action="{!initList}" controller="PublicJobSearchController" standardStylesheets="true"> <!-- The site template provides the layout and the style for the site --> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form > <!-- Search by Department, Location and Keyword --> <apex:pageBlock title="Search Job Postings"> <apex:pageBlockSection columns="1"> <apex:pageBlockSectionItem > <apex:outputText value="Department"/> <apex:selectList value="{!viewDepartmentName}" id="departmentViews" size="1" required="true"> <apex:selectOptions value="{!DepartmentViewNames}"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputText value="Location"/> <apex:selectList value="{!viewLocationName}" id="locationViews" size="1" required="true"> <apex:selectOptions value="{!LocationViewNames}"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputText value="Keyword"/> <apex:inputText value="{!searchPosition}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputText value=""/> <apex:commandButton value="Search" action="{!PopulateQuery}" reRender="JobList" /> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> <!-- Search results --> <apex:pageBlock title="Search Results"> <apex:pageBlockTable id="JobList" value="{!Position}" var="Position__c" rendered="{!NOT(ISNULL(Position))}"> <apex:column > <apex:facet name="header"> <apex:outputText value="Position ID"/> </apex:facet> <apex:outputLink value="PublicJobDetails?id={!Position__c.id}" id="theLink">{!Position__c.name}</apex:outputLink> <!-- Position name field is linked to the job details page --> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Title"/> </apex:facet> <apex:outputText value="{! Position__c.Position_Type__r.Name}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Department"/> </apex:facet> <apex:outputText value="{!Position__c.Department__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Location"/> </apex:facet> <apex:outputText value="{!Position__c.Location_City_State_Country__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Job Description"/> </apex:facet> <apex:outputText value="{!Position__c.Job_Description__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Position Open Date"/> </apex:facet> <apex:outputText value="{!Position__c.Open_Position_Date__c}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:define> </apex:composition> </apex:page>

 

PublicJobDetails VF Markup:

<apex:page showheader="false" action="{!initList}" controller="PublicJobSearchController" standardStylesheets="true"> <!-- The site template provides the layout and the style for the site --> <apex:composition template="{!$Site.Template}"> <apex:define name="body"> <apex:form > <!-- Search by Department, Location and Keyword --> <apex:pageBlock title="Search Job Postings"> <apex:pageBlockSection columns="1"> <apex:pageBlockSectionItem > <apex:outputText value="Department"/> <apex:selectList value="{!viewDepartmentName}" id="departmentViews" size="1" required="true"> <apex:selectOptions value="{!DepartmentViewNames}"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputText value="Location"/> <apex:selectList value="{!viewLocationName}" id="locationViews" size="1" required="true"> <apex:selectOptions value="{!LocationViewNames}"/> </apex:selectList> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputText value="Keyword"/> <apex:inputText value="{!searchPosition}"/> </apex:pageBlockSectionItem> <apex:pageBlockSectionItem > <apex:outputText value=""/> <apex:commandButton value="Search" action="{!PopulateQuery}" reRender="JobList" /> </apex:pageBlockSectionItem> </apex:pageBlockSection> </apex:pageBlock> </apex:form> <!-- Search results --> <apex:pageBlock title="Search Results"> <apex:pageBlockTable id="JobList" value="{!Position}" var="Position__c" rendered="{!NOT(ISNULL(Position))}"> <apex:column > <apex:facet name="header"> <apex:outputText value="Position ID"/> </apex:facet> <apex:outputLink value="PublicJobDetails?id={!Position__c.id}" id="theLink">{!Position__c.name}</apex:outputLink> <!-- Position name field is linked to the job details page --> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Title"/> </apex:facet> <apex:outputText value="{! Position__c.Position_Type__r.Name}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Department"/> </apex:facet> <apex:outputText value="{!Position__c.Department__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Location"/> </apex:facet> <apex:outputText value="{!Position__c.Location_City_State_Country__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Job Description"/> </apex:facet> <apex:outputText value="{!Position__c.Job_Description__c}"/> </apex:column> <apex:column > <apex:facet name="header"> <apex:outputText value="Position Open Date"/> </apex:facet> <apex:outputText value="{!Position__c.Open_Position_Date__c}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock> </apex:define> </apex:composition> </apex:page>

SiteRegisterController Apex Class:

 

/** * An apex class that creates a portal user */ public class SiteRegisterController { // PORTAL_ACCOUNT_ID is the account on which the contact will be created on and then enabled as a portal user. // you need to add the account owner into the role hierarchy before this will work - please see Customer Portal Setup help for more information. private static Id PORTAL_ACCOUNT_ID = '0018000000V7oup'; public SiteRegisterController () { } public String username {get; set;} public String email {get; set;} public String password {get; set {password = value == null ? value : value.trim(); } } public String confirmPassword {get; set { confirmPassword = value == null ? value : value.trim(); } } public String communityNickname {get; set { communityNickname = value == null ? value : value.trim(); } } private boolean isValidPassword() { return password == confirmPassword; } public PageReference registerUser() { // it's okay if password is null - we'll send the user a random password in that case if (!isValidPassword()) { ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.ERROR, Label.site.passwords_dont_match); ApexPages.addMessage(msg); return null; } User u = new User(); u.Username = username; u.Email = email; u.CommunityNickname = communityNickname; String accountId = PORTAL_ACCOUNT_ID; // lastName is a required field on user, but if it isn't specified, we'll default it to the username String userId = Site.createPortalUser(u, accountId, password); if (userId != null) { if (password != null && password.length() > 1) { return Site.login(username, password, null); } else { PageReference page = System.Page.SiteRegisterConfirm; page.setRedirect(true); return page; } } return null; } // Test method to bring this class's test coverage over the required 75% static testMethod void testRegistration() { SiteRegisterController controller = new SiteRegisterController(); controller.username = 'test@force.com'; controller.email = 'test@force.com'; controller.communityNickname = 'test'; // registerUser will always return null when the page isn't accessed as a guest user System.assert(controller.registerUser() == null); controller.password = 'abcd1234'; controller.confirmPassword = 'abcd123'; System.assert(controller.registerUser() == null); } }

 

Best Answer chosen by Admin (Salesforce Developers) 
BulentBulent
Please check the Field level security for the Position/position type custom objects for your portal user profiles and make sure fields you want to display are marked as visible. And you might want to disable the portal user i just self-service registered on your portal for testing.
Message Edited by Bulent on 08-03-2009 09:43 AM

All Answers

BulentBulent
Please check the Field level security for the Position/position type custom objects for your portal user profiles and make sure fields you want to display are marked as visible. And you might want to disable the portal user i just self-service registered on your portal for testing.
Message Edited by Bulent on 08-03-2009 09:43 AM
This was selected as the best answer
SCRSCR
Thanks very much, Bulent.