Guest User

Untitled

a guest
Apr 26th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.40 KB | None | 0 0
  1. <apex:selectList value="{!SelectedNomination}" size="1" id="a">
  2. <apex:selectOptions value="{!contactlist}"></apex:selectOptions>
  3. </apex:selectList>
  4.  
  5. public List<Nominator__c> Nominators = new List<Nominator__c>();
  6.  
  7. public List<SelectOption> contactlist
  8. {
  9.  
  10. get
  11. {
  12.  
  13. String state =
  14. application.Congressional_State_Territory__c.substring(0,2);
  15.  
  16. Nominators = [Select Id, Name, Class_Year__c, Contact_Name__c,
  17. Nominator_Code__c, Nominator_Type__c from Nominator__c WHERE
  18. FirstTwoLetters__c =: state and Nominator_Type__c=
  19. 'Congressional - House' and Class_Year__c =:
  20. application.Class_Year__c and Status__c =:'Active' ];
  21.  
  22. contactlist = new List<SelectOption>();
  23.  
  24. for(Nominator__c nom : Nominators)
  25. {
  26. contactlist.add(new SelectOption(nom.Id, nom.Name + ' ' +
  27. nom.Contact_Name__c));
  28. }
  29.  
  30. **contactlist.sort();**
  31. return contactlist;
  32. }
  33. set {}
  34. }
  35.  
  36. Nominators = [Select Id, Name, Class_Year__c, Contact_Name__c,
  37. Nominator_Code__c, Nominator_Type__c
  38. from Nominator__c
  39. WHERE
  40. FirstTwoLetters__c =: state
  41. and Nominator_Type__c= 'Congressional - House'
  42. and Class_Year__c =: application.Class_Year__c
  43. and Status__c =:'Active'
  44. ORDER BY Name ASC] ;
Add Comment
Please, Sign In to add comment