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
dev401hasdev401has 

Render not working with repeater in Force.com Site

Hi All,

 

I have a situation where I am not able to figure out what is going wrong with my rendered attribute.

 

I have a picklist field in my object which has values like PDF, Excel, Word etc.

 

I am simply firing a query on that object. Retrieving all the records based on condition and displaying them on Visualforce page using <apex:outputlink> under <apex:repeat>

I simply want is that it should display icon PDF if value for record is PDF and Excel icon if value for record is Excel

 

code:

<apex:repeat value="{!List}" var="c" id="theRepeat" >

<apex:image value="{!URLFOR($staticresource, 'folder/pdf.jpg')}" rendered="{!c.picklistfield__c=='PDF'}" />

<apex:image value="{!URLFOR($staticresource, 'folder/excel.jpg')}" rendered="{!c.picklistfield__c=='Excel'}" />

<apex:outputLink value="{!c.url__c}" >

{!c.Name}

</apex:outputLink>

</apex:repeat>

 

This works very well in Visualforce page but when i use this page in Force.com Site then rendered portion is not working.

If I directly use rendered = true then it works in site.

Best Answer chosen by Admin (Salesforce Developers) 
Ryan-GuestRyan-Guest

Have you checked the Public Access Settings and Field Level Security (FLS) on picklistfield__c?

All Answers

Ryan-GuestRyan-Guest

Have you checked the Public Access Settings and Field Level Security (FLS) on picklistfield__c?

This was selected as the best answer
dev401hasdev401has

Thanks a lot.

Your solution was bang on target!!!

I missed that out. Field was not visible to that profile.

 

Thanks a lot again.

Ryan-GuestRyan-Guest

No problem.

 

The security for the Site profile is a little different than other profiles. Most options default to off (rather than defaulting to on). This is to make sure that you explicitly agree to show data on your public website (since it can be viewable anonymously, outside your organization).