Hi Pooja, Try the below code, this might help you to run flow in a modal dialog.
Controller<aura:component>
<aura:attribute name="{!isOpen}" type="Boolean" default="false" access="private"/>
<aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
<aura:if isTrue="{!v.isOpen}">
<div style="height: 640px;">
<section role="dialog" tabindex="-1" class="slds-modal slds-fade-in-open">
<div class="slds-modal__container">
<header class="slds-modal__header slds-modal__header_empty">
<lightning:buttonIcon iconName="utility:close" class="slds-modal__close" onclick="{!c.closeFlowModal}"/>
</header>
<div class="slds-modal__content slds-p-around_medium">
<lightning:flow aura:id="flow" onstatuschange="{!c.closeModalOnFinish}" />
</div>
</div>
</section>
<div class="slds-backdrop slds-backdrop_open"></div>
</div>
</aura:if>
</aura:component>
Please mark it as Best Answer if the above information was helpful.Thanks.doInit : function(component, event, helper) {
component.set('v.isOpen', true);
var flow = component.find('flow');
flow.startFlow('Flow_Name');
},
closeFlowModal : function(component, event, helper) {
component.set("v.isOpen", false);
},
closeModalOnFinish : function(component, event, helper) {
if(event.getParam('status') === "FINISHED") {
component.set("v.isOpen", false);
}
}
1 respuesta