5

I am actually creating a component that will implement the force:lightningQuickAction so that my component open in a modal window from the action button.I would like to capture the event where the user cliked on the save button, but there is no place that explain how to do it.

I found from the official doc that i can, from my component call the close method of the modal. But i want to access the save action.

I think that it is not an impossible thing to do, as salesforce already implemented the lightning event, used to communicate between components without sharing variable parameters between them.

So isn't there something like registering to a certain event from my parent modal and executing an action when the event fire or something similar to achieve this?

1

2 Answers 2

1

As mentioned by @CasparHarmer's comment - try implementing the force:lightningQuickActionWithoutHeader interface in the component's implements attribute and create the save button yourself

0

Try this. After few css trick, I managed to fix it myself. This solution override the dialog box height which you mentioned while creating custom action on an object. I hope this will help someone needed.

<aura:component implements="force:lightningQuickActionWithoutHeader,force:hasRecordId" controller="MilindTest">     
<style>
    .cuf-content {
    padding: 0 0rem !important;
    }
    .slds-p-around--medium {
    padding: 0rem !important;
    }
    .slds-modal__content {
    overflow-y: hidden !important;
    height: unset !important;
    max-height: unset !important;
    }        
</style>

<div class="slds-col modal-header slds-modal__header">
    <h2 class="title slds-text-heading--medium">Milind Test</h2>
</div>
<div class="slds-col modal-body scrollable slds-p-around--medium" style="height: 200px; max-height: 400px; overflow-y: auto !important">
    <div>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
        <p>&nbsp;</p>
    </div>
</div>
<div class="slds-col modal-footer slds-modal__footer">        
    <lightning:button variant="neutral" label="Cancel" onclick="{! c.cancelClick }" />      
    <lightning:button variant="brand" label="Save" onclick="{! c.saveClick }" />
</div>

2
  • 6
    Not good to add CSS like this. One should use the style component to add CSS. Commented Jan 6, 2018 at 5:48
  • 2
    I think the last release disallows style tags in the component body. Better to implement a headless global action and add your own save button. Commented Mar 14, 2018 at 21:35

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .