I am trying to create a dynamic component and i am able to load "loadingSWQuotes" component successfully. I want to pass the quoteid as a parameter to the component.
init : function(component, event, helper) {
var modalBody;
var modalFooter;
var quoteid = event.currentTarget.dataset.id;
alert(quoteid);
component.set("v.Quote_id", quoteid);
$A.createComponents([
["c:loadingSWQuotes",{
"aura:recordId": quoteid
}]
],
function(components, status){
if (status === "SUCCESS") {
modalBody = components[0];
component.find('overlayLib').showCustomModal({
header: "Quotes",
body: modalBody,
footer: modalFooter,
showCloseButton: true,
cssClass: "my-modal,my-custom-class,my-other-class",
closeCallback: function() {
}
});
}
});
}
Component I have hard coded the record id in the component now. I want to pass it dynamically
<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,force:lightningQuickAction"
access="global" controller="FilesController">
<!--<aura:attribute name="recordId" type="String"/>-->
<aura:attribute name="filesIds" type="list"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:attribute name="recordId" type="string" default="a0902000000IFmjAAG"/>
<lightning:recordViewForm recordId="a0902000000IFmjAAG" objectApiName="Opportunity_Quotes__c" >
<!--<lightning:recordEditForm objectApiName="Opportunity_Quotes__c" onsuccess="{!c.handleSuccess}">-->
<lightning:messages />
<lightning:outputField fieldName="QuoteId__c" />
<lightning:outputField fieldName="Status__c" />
<lightning:outputField fieldName="CurrMembers__c" />
<lightning:outputField fieldName="FinalIncrease__c" />
<lightning:outputField fieldName="FinalRev__c" />
</lightning:recordViewForm>
</aura:component>