Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <apex:repeat value="{!mycourses}" var="course">
- <apex:outputText value="{!PercentComplete}">
- <apex:param name="courseIdDetail" value="{!course.id}" assignTo="{!courseIdDetail}"/>
- </apex:outputText>
- </apex:repeat>
- public String courseIdDetail {get;set;}
- public String getPercentComplete(){
- System.debug('courseIdDetail from page = ' + courseIdDetail); //coming back as null
- AggregateResult[] avgProgress = [select AVG(Progress__c)avg
- FROM Tests__c
- WHERE Course__c =: courseId }
- String progress = String.valueOf(avgProgress[0].get('avg'));
- return progress;
- }
- public class CourseWrapper {
- public Course__c course {get; set;}
- public CourseWrapper(Course__c c) {
- course = c;
- }
- public String getPercentComplete() {
- ... WHERE Course__c =: course.Id ...
- }
- }
- public List<CourseWrapper> mycourses {get; set;}
- <apex:repeat ...>
- <apex:outputText value="{!course.percentComplete}" />
- </apex:repeat>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement