You need to sign in to do that
Don't have an account?
Matt Eck
Trouble with Wrappers - Unknown property 'VisualforceArrayList.GiverId'
I'm trying to write a visualforce page that will display badge information when given a recipient ID number. I need to use a wrapper class otherwise I would need 2 values going into my pageBlockTable values.
Everything on the Apex side seems to be working fine but when I try to access the information from visualforce I get this error "Unknown property 'VisualforceArrayList.GiverId'".
Apex Class:
Visualforce Page:
Everything on the Apex side seems to be working fine but when I try to access the information from visualforce I get this error "Unknown property 'VisualforceArrayList.GiverId'".
Apex Class:
public with sharing class GetBadges { public List<BadgeWrapper> Wrappers { get; set; } public class BadgeWrapper { public List<WorkBadge> Results {get; set;} public String GID {get; set;} public List<User> Results2 {get; set;} public BadgeWrapper(List<WorkBadge> wl, String g, List<User> ul) { Results = wl; GID = g; Results2 = ul; } } public GetBadges() { Wrappers = new List<BadgeWrapper>(); List<WorkBadge> wl = [SELECT GiverId, Message, ImageURL, Description, DefinitionId FROM WorkBadge WHERE RecipientId = '00536000002UKV1']; String g = String.valueOf(wl[0]); List<User> ul = [SELECT Name FROM User WHERE ID = :g]; Wrappers.add(new BadgeWrapper(wl,g,ul)); } }
Visualforce Page:
<apex:pageBlock title="Badge Certificate"> <apex:pageBlockTable value="{!Wrappers}" var="row"> <apex:column > <!--apex:facet name="giverID">Giver's ID</apex:facet--> <apex:outputText value="{!row.Results.GiverId}"/> </apex:column> </apex:pageBlockTable> </apex:pageBlock>I'm not sure why I'm getting this error any help would be really appreciated. Thanks!
String g = String.valueOf(wl[0].GiverId);
and then line #5 of the VF should be
<apex:otuputText value="{!row.results.GID}" />
I had to put the row number in the visualforce page so it should have been now I'll just need to put these in a repeater and I should be all set. Thanks for the help!