You need to sign in to do that
Don't have an account?
Molson94
<apex:repeat> Not rendering / showing values
Hello,
I am losing my mind trying to sort out why apex:repeat is not working on my visualforce page.
I've used apex:repeat before and never had any issue.
The VF page is loading, and the logs show that the SOQL list "repeatedList" has values.
The page loads fine, and nothing is shown in the apex:repeat section of the page.
Are there any other considerations I may be missing that will prevent apex:repeat from working?
VF Page:
Thanks in advance!
I am losing my mind trying to sort out why apex:repeat is not working on my visualforce page.
I've used apex:repeat before and never had any issue.
The VF page is loading, and the logs show that the SOQL list "repeatedList" has values.
The page loads fine, and nothing is shown in the apex:repeat section of the page.
Are there any other considerations I may be missing that will prevent apex:repeat from working?
VF Page:
<apex:repeat value="{!repeatedList}" var="a"> <apex:outputText value="{!a.id}" /> </apex:repeat>Controller:
public class cb_controller { public list<object__c> repeatedList {get; set;} public cb_controller(){ list<object__c> repeatedList = new list<object__c>(); List<object__c> soqlList = new List<object__c>([ SELECT id FROM Object__c ]); for(Object__c x : soqlList){ repeatedList.add(x); system.debug(x); } }
Thanks in advance!
Try changing the Controller code to this.
Controller :
I have tried in my org and it is working fine. Here it is my code.
VisualForce page:
Controller :
Screenshot :
Hope it Helps you. Please mark this as solved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Regards ,
Suraj
All Answers
Try changing the Controller code to this.
Controller :
I have tried in my org and it is working fine. Here it is my code.
VisualForce page:
Controller :
Screenshot :
Hope it Helps you. Please mark this as solved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Regards ,
Suraj
Thanks for the reply. What is the difference in what i posted and what you posted? I was able to get this working properly only if i wrote out the "get" method instead of using the shorthand {get;set;}
Thanks!
The only difference is in Line no 5 of your Controller Code i.e
You have initialized the list in the constructor. Instead, you need to write only
Hope it Helps you. Please mark this as solved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Regards ,
Suraj