Skip to main content
Hi, I have created new lighting component and missing Save button at bottom. I can only see Cancel button. What a strange? Am I missing something? What is the solution? see below component.

On standard object, I have added New Action button and selected lightning component.

component:

<aura:component implements="force:lightningQuickAction,force:appHostable,force:hasRecordId" controller="Test">

 <aura:attribute name="recordId" type="Id" required="true" default="{!v.recordId}" />

</aura:component>

controller js:

({

 doSave : function(component, event, helper) { 

        console.log(component.get('v.recordId'));

        console.log('dosave called');

        var action =  component.get('c.ping');

        action.setParams({ msg : "Hello world" });

       

        action.setCallback(this, function(response) {

            console.log('setCallback called');

            var state = response.getState();

            if (state === "SUCCESS") {   

    

                // Display the total in a "toast" status message

                var resultsToast = $A.get("e.force:showToast");

                resultsToast.setParams({

                    "title": "Good day",

                    "message": "Hello World"

                });

                resultsToast.fire();

               

                // Close the action panel

                var dismissActionPanel = $A.get("e.force:closeQuickAction");

                dismissActionPanel.fire();   

              

                console.log("From server: " + response.getReturnValue());

            }

            else if (state === "INCOMPLETE") {

                console.log(response.getReturnValue());

            }

            else if (state === "ERROR") {

                var errors = response.getError();

                if (errors) {

                    if (errors[0] && errors[0].message) {

                        console.log("Error message: " +

                                 errors[0].message);

                    }

                } else {

                    console.log("Unknown error");

                }

            }

        });

        console.log('calling server-side action');       

        $A.enqueueAction(action);

 }

})
1 answer
  1. Nov 2, 2017, 5:36 AM
    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">

    <button class="slds-button slds-button--neutral uiButton--default uiButton--default uiButton" type="button">

    <lightning:button variant="neutral" label="Cancel" onclick="{! c.cancelClick }" />

    </button>

    <button class="slds-button slds-button--neutral uiButton--default uiButton--brand uiButton" type="button">

    <lightning:button variant="brand" label="Save" onclick="{! c.saveClick }" />

    </button>

    </div>

    </aura:component>

     
0/9000