You need to sign in to do that
Don't have an account?
LJanik
Simple Query - No fields shown
I have a simple query of a custom object. It is showing the correct number of records(3), but the fields are blank.
Public List<TestObject__c> specialists;
public List<TestObject__c> getSpecialists() { return specialists; } public PageReference search(){ specialists = Database.query('select AnimalType__c from TestObject__c'); return null; }
<apex:form > <apex:commandButton action="{!search}" value="Search" /> </apex:form> <apex:dataList var="s" value="{!specialists}" id="list"> Type: <apex:outputText value="{!s.AnimalType__c}" /> </apex:dataList>
Issue resolved. This was not an Apex problem, but a Force.com Sites problem.
In the Sites profile, modify Public Access Settings. Edit Custom Object Permissions and check READ for Basic Access for the custom object.
All Answers
Hmm, I have a feeling it has to do with your objects because the code seems fine. Here is what I did, maybe it will help you debug.
Apex Class:
VisualForce Page:
Results:
Hope that helps
I'm stumped. Seems like a permission problem? Here is my Sites link:
http://free-12352c25bf4.force.com/Test1/TestPageA
Issue resolved. This was not an Apex problem, but a Force.com Sites problem.
In the Sites profile, modify Public Access Settings. Edit Custom Object Permissions and check READ for Basic Access for the custom object.