Advertisement
Guest User

Untitled

a guest
Jul 26th, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None | 0 0
  1. <apex:repeat value="{!mycourses}" var="course">
  2. <apex:outputText value="{!PercentComplete}">
  3. <apex:param name="courseIdDetail" value="{!course.id}" assignTo="{!courseIdDetail}"/>
  4. </apex:outputText>
  5. </apex:repeat>
  6.  
  7. public String courseIdDetail {get;set;}
  8. public String getPercentComplete(){
  9. System.debug('courseIdDetail from page = ' + courseIdDetail); //coming back as null
  10. AggregateResult[] avgProgress = [select AVG(Progress__c)avg
  11. FROM Tests__c
  12. WHERE Course__c =: courseId }
  13. String progress = String.valueOf(avgProgress[0].get('avg'));
  14. return progress;
  15. }
  16.  
  17. public class CourseWrapper {
  18. public Course__c course {get; set;}
  19. public CourseWrapper(Course__c c) {
  20. course = c;
  21. }
  22. public String getPercentComplete() {
  23. ... WHERE Course__c =: course.Id ...
  24. }
  25. }
  26.  
  27. public List<CourseWrapper> mycourses {get; set;}
  28.  
  29. <apex:repeat ...>
  30. <apex:outputText value="{!course.percentComplete}" />
  31. </apex:repeat>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement