Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- if(fieldType == 'PICKLIST'){
- var getPLValue = component.get("c.getPickListValues");
- getPLValue.setParams({"fieldAPI" : fieldAPIName});
- getPLValue.setCallback(this, function(response){
- component.set("v.ResponsePL",response.getReturnValue());
- $A.createComponent(
- "c:NIIMBL_Dynamic_Picklist",
- {
- "options": response.getReturnValue(),
- "default" : "Yes",
- "name": fieldLabel,
- "label": fieldLabel,
- "required" : false,
- "value" : ""
- },
- function(newPicklist) {
- var body = component.get("v.formBody");
- body.push(newPicklist);
- component.set("v.formBody",body);
- });
- });
- $A.enqueueAction(getPLValue);
- }
- else if(fieldType == 'EMAIL'){
- $A.createComponent(
- "lightning:input",
- {
- "value" : component.getReference("v.EventRSVP."+ fieldAPIName),
- "aura:id": "findableAuraId",
- "label": fieldLabel,
- "required" : true,
- "type" : 'Email'
- },
- function(newInput, status, errorMessage){
- if (status === "SUCCESS") {
- var body = component.get("v.formBody");
- body.push(newInput);
- component.set("v.formBody",body);
- }
- else if (status === "INCOMPLETE") {
- console.log("No response from server or client is offline.")
- }
- else if (status === "ERROR") {
- console.log("Error: " + errorMessage);
- }
- });
- }
- else if(fieldType=="STRING")
- {
- $A.createComponent(
- "lightning:input",
- {
- "value" : component.getReference("v.EventRSVP."+ fieldAPIName),
- "aura:id": "findableAuraId",
- "label": fieldLabel,
- "required" : true
- },
- function(newInput, status, errorMessage){
- if (status === "SUCCESS") {
- var body = component.get("v.formBody");
- body.push(newInput);
- component.set("v.formBody",body);
- }
- else if (status === "INCOMPLETE") {
- console.log("No response from server or client is offline.")
- }
- else if (status === "ERROR") {
- console.log("Error: " + errorMessage);
- }
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement