Guest User

Untitled

a guest
Jan 23rd, 2018
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.37 KB | None | 0 0
  1. <apex:page standardController="Webinar__c" extensions="CheckAllUsingJavascriptController" sidebar="false">
  2. <apex:form >
  3.  
  4. <apex:pageBlock >
  5. <apex:outputLabel > Countries : </apex:outputLabel>
  6. <apex:selectList size="1" value="{!selectedCountry}">
  7. <apex:selectOptions value="{!countrieLst }"/>
  8. </apex:selectList> <br/>
  9. </apex:pageBlock>
  10. </apex:form>
  11. </apex:page>
  12.  
  13. public List<wrapAccount> wrapperAccountList {get; set;}
  14. public List<System.SelectOption> countrieLst {get;set;}
  15. public String selectedCountry{get;set;}
  16.  
  17. List<Lead> LeadList = new List<Lead>();
  18.  
  19. public CheckAllUsingJavascriptController (Apexpages.StandardController stdcController){
  20. //List<LightiningEd__Webinar_Attendees_Status__c> selectedContacts = new List<LightiningEd__Webinar_Attendees_Status__c>();
  21. countrieLst = new List<System.SelectOption>();
  22. if(wrapperAccountList == null) {
  23. wrapperAccountList = new List<wrapAccount>();
  24.  
  25. for(LightiningEd__Webinar__c a1: [select id,Name,Start_Time__c,Finish_Time__c,Registration_URL__c,Expired__c,SCO_ID__c,Retrival_Date__c,(select id,Name,principal_id__c,Login__c,isLead__c,Attandance_Status__c,Duration_Spend__c,Company_Name__c,City__c,State__c,Country__c,Mobile_Phone__c from LightiningEd__Webinar_Attendees_Statuss__r) from LightiningEd__Webinar__c where id = :ApexPages.currentPage().getParameters().get('id')]) {
  26. for(LightiningEd__Webinar_Attendees_Status__c a : a1.LightiningEd__Webinar_Attendees_Statuss__r){
  27.  
  28. wrapperAccountList.add(new wrapAccount(a));
  29.  
  30. }
  31. }
  32. }
  33. }
  34.  
  35. public PageReference processSelected(){
  36.  
  37. List<LightiningEd__Webinar_Attendees_Status__c> selectedContacts = new List<LightiningEd__Webinar_Attendees_Status__c>();
  38. countrieLst = new List<System.SelectOption>();
  39. //countryOptions = new List<System.SelectOption>();
  40. for(wrapAccount cCon: wrapperAccountList){
  41. if(cCon.selected == true){
  42.  
  43. selectedContacts.add(cCon.acc);
  44.  
  45. }
  46. }
  47.  
  48. System.debug('These are the selected Contacts...'+selectedContacts);
  49. for(LightiningEd__Webinar_Attendees_Status__c acc : selectedContacts){
  50.  
  51. system.debug('selected records::::'+acc);
  52.  
  53. countrieLst.add(new System.SelectOption(acc.Name,acc.Name));
  54. countrieLst.add(new System.SelectOption(acc.LightiningEd__Login__c,acc.LightiningEd__Login__c));
  55. countrieLst.add(new System.SelectOption(acc.LightiningEd__Attandance_Status__c,acc.LightiningEd__Attandance_Status__c));
  56. countrieLst.add(new System.SelectOption(acc.LightiningEd__Company_Name__c,acc.LightiningEd__Company_Name__c));
  57. countrieLst.add(new System.SelectOption(acc.LightiningEd__City__c,acc.LightiningEd__City__c));
  58. countrieLst.add(new System.SelectOption(acc.LightiningEd__State__c,acc.LightiningEd__State__c));
  59. countrieLst.add(new System.SelectOption(acc.LightiningEd__Country__c,acc.LightiningEd__Country__c));
  60. countrieLst.add(new System.SelectOption(acc.LightiningEd__Mobile_Phone__c,acc.LightiningEd__Mobile_Phone__c));
  61.  
  62. System.debug('CountryOptions:::'+countrieLst);
  63. //countryOptions1.addAll(countryOptions);
  64.  
  65.  
  66. }
  67.  
  68. wrapperAccountList=null;
  69. return null;
  70.  
  71. public class wrapAccount {
  72.  
  73. public LightiningEd__Webinar_Attendees_Status__c acc {get; set;}
  74. public Boolean selected {get; set;}
  75. public wrapAccount(LightiningEd__Webinar_Attendees_Status__c a) {
  76. acc = a;
  77. selected = false;
  78. }
  79. }
Add Comment
Please, Sign In to add comment