Advertisement
Guest User

Untitled

a guest
Mar 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.23 KB | None | 0 0
  1. if(fieldType == 'PICKLIST'){
  2.  
  3. var getPLValue = component.get("c.getPickListValues");
  4. getPLValue.setParams({"fieldAPI" : fieldAPIName});
  5. getPLValue.setCallback(this, function(response){
  6. component.set("v.ResponsePL",response.getReturnValue());
  7. $A.createComponent(
  8. "c:NIIMBL_Dynamic_Picklist",
  9. {
  10. "options": response.getReturnValue(),
  11. "default" : "Yes",
  12. "name": fieldLabel,
  13. "label": fieldLabel,
  14. "required" : false,
  15. "value" : ""
  16. },
  17. function(newPicklist) {
  18. var body = component.get("v.formBody");
  19. body.push(newPicklist);
  20. component.set("v.formBody",body);
  21. });
  22. });
  23. $A.enqueueAction(getPLValue);
  24. }
  25.  
  26. else if(fieldType == 'EMAIL'){
  27. $A.createComponent(
  28. "lightning:input",
  29. {
  30. "value" : component.getReference("v.EventRSVP."+ fieldAPIName),
  31. "aura:id": "findableAuraId",
  32. "label": fieldLabel,
  33. "required" : true,
  34. "type" : 'Email'
  35. },
  36. function(newInput, status, errorMessage){
  37. if (status === "SUCCESS") {
  38. var body = component.get("v.formBody");
  39. body.push(newInput);
  40. component.set("v.formBody",body);
  41. }
  42. else if (status === "INCOMPLETE") {
  43. console.log("No response from server or client is offline.")
  44. }
  45. else if (status === "ERROR") {
  46. console.log("Error: " + errorMessage);
  47. }
  48. });
  49. }
  50.  
  51.  
  52. else if(fieldType=="STRING")
  53. {
  54.  
  55. $A.createComponent(
  56. "lightning:input",
  57. {
  58. "value" : component.getReference("v.EventRSVP."+ fieldAPIName),
  59. "aura:id": "findableAuraId",
  60. "label": fieldLabel,
  61. "required" : true
  62. },
  63. function(newInput, status, errorMessage){
  64. if (status === "SUCCESS") {
  65. var body = component.get("v.formBody");
  66. body.push(newInput);
  67. component.set("v.formBody",body);
  68. }
  69. else if (status === "INCOMPLETE") {
  70. console.log("No response from server or client is offline.")
  71. }
  72. else if (status === "ERROR") {
  73. console.log("Error: " + errorMessage);
  74. }
  75. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement