Advertisement
Guest User

Untitled

a guest
Mar 29th, 2017
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.34 KB | None | 0 0
  1. @AuraEnabled
  2. public static List<SelectOption> ObjectNames()
  3. {
  4. system.debug('object is calling:::');
  5. List<SelectOption> ObjNames= new List<SelectOption>();
  6. ObjNames.add(new SelectOption('','--None--'));
  7. ObjNames.add(new selectoption('Pay_Element_Master__c','Pay Element'));
  8. ObjNames.add(new selectoption('CTC_Master__c','CTC Master'));
  9. ObjNames.add(new selectoption('Section_Master__c','Section Master'));
  10. return ObjNames;
  11.  
  12. public class SelectOption {
  13. public SelectOption(String value, String label) {
  14. this.value = value;
  15. this.label = label;
  16. this.disabled = false;
  17. this.escapeItem = false;
  18. }
  19.  
  20. public SelectOption(String value, String label, Boolean isDisabled) {
  21. this.value = value;
  22. this.label = label;
  23. this.disabled = isDisabled;
  24. this.escapeItem = false;
  25. }
  26.  
  27. @AuraEnabled
  28. public String label { get;set; }
  29. @AuraEnabled
  30. public String value { get;set; }
  31. @AuraEnabled
  32. public Boolean disabled { get;set; }
  33. @AuraEnabled
  34. public Boolean escapeItem { get;set; }
  35.  
  36. componentVal:function(component,event,helper){
  37. alert('iam component calling:::');
  38. var action=component.get("c.ObjectNames");
  39. action.setCallback(this,function(re){
  40. var state=re.getState();
  41. if(state==='SUCCESS'){
  42. alert(':::::::'+JSON.stringify(re.getReturnValue()));
  43. }
  44. });
  45. $A.enqueueAction(action);
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement