I need to create a contract after getting confirmation from user like this:
I'm using simple lds to create a contract, when the user selects okay I should be able to create a contract. I have used overlayLibrary modal to show this cancel/ok modal, code is:
I followed this link to use overlayLibrary modal: link
how do we call the handleApplicationEvent in this code, if okay is clicked I want the lds component to open and show the contract create record.
OverLayLibraryModal.cmp
<aura:component access="global">
<aura:registerEvent name="handleApplicationEvent" type="c:OverlayLibraryModalEvent"/>
<lightning:overlayLibrary aura:id="overlayLib"/>
<!--Component Start-->
<div class="slds-text-align_center slds-m-around_x-medium">
<lightning:button name="cancel" label="Cancel" onclick="{!c.handleCancel}"/>
<lightning:button name="ok" label="OK" variant="brand" onclick="{!c.handleOK}"/>
</div>
<!--Component End-->
</aura:component>
OverlayLibraryModalController.js
({
handleCancel : function(component, event, helper) {
//closes the modal or popover from the component
var appEvent = $A.get("e.c:OverlayLibraryModalEvent");
appEvent.setParams({
"message" : "Cancel"
});
appEvent.fire();
component.find("overlayLib").notifyClose();
},
handleOK : function(component, event, helper) {
//do something
var appEvent = $A.get("e.c:OverlayLibraryModalEvent");
appEvent.setParams({
"message" : "Ok"
});
appEvent.fire();
//component.find("overlayLib").notifyClose();
}
})
Parent component
<aura:handler event="c:OverlayLibraryModalEvent" action="{!c.handleApplicationEvent}"/>
<lightning:overlayLibrary aura:id="overlayLib"/>