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

Want to display table in force.com site dynamically through a custom custom controller and Vfpage
Hi,
I'm in need of displaying table dynamically in force.com site.
And created VF page and controller for this table VF page.
For this, I have a custom object called 'Directory__c" details in my account.
I created the table in VF page using the following code,
<apex:page controller="directory" showheader="false">
<br/>
<br/>
<apex:panelGrid columns="1" id="theGrid" width="50%" >
<apex:pageBlock >
<apex:form >
<apex:dataTable value="{!dir}" var="dir1" styleClass="list">
<apex:column >
<apex:facet name="header">Name</apex:facet>
<apex:outputText value="{!dir1.First_Name__c}"/>
</apex:column>
<apex:column >
<apex:facet name="header">Phone</apex:facet>
<apex:outputText value="{!dir1.Phone_no__c}"/>
</apex:column>
</apex:dataTable>
</apex:form>
</apex:pageBlock>
</apex:panelGrid>
</apex:page>
Controller for the VF page is below,
public class directory {
Directory__c [] dir;
public List<Directory__c > getDir (){
if(dir== null){
dir= [select First_Name__c, Phone_no__c from Directory__c limit 10];
}
return dir;
}
}
The problem was the vf page is getting reflected in Salesforce.com while running as an Apex Vf page.
But, when i add this page to the force.com site and tried to run its not getting reflected.
Have anyone know the solution please reply me.
Thanks in Advance,
Kamatchi Devi.R
Check the public access setting for the force.com site.
Check whether you enabled Read access to the object and other dependent object or class
All Answers
Check the public access setting for the force.com site.
Check whether you enabled Read access to the object and other dependent object or class
Thank you karanraj.
In public access setting for site i didn't give field permission.Thats the problem.
Now its working...!
regards,
Kamatchi Devi R
Don't forget to give Kudos if my previous post helps you.