3

I have used a lightning button in the component. I have to use both SUBMIT and Cancel Buttons. But Already Cancel Button Popping up. Either I have to remove the Cancel button and add Custom Cancel button also Or I have to place Submit button beside the standard cancel button

Component:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction"
            access="global"
            controller="P2EcdependentPicklist_NewRFI">
<!-- call doInit function on component load -->  
<aura:handler name="init" value="this" action="{!c.doInit}"/>

   <aura:attribute name="recordId" type="Id" />
   <aura:attribute name="recordtypevalu" type="string" />

<!-- aura attributes-->  
<aura:attribute name="listControllingValues" type="list" default="[]" description="to store controller field values"/>
<aura:attribute name="listDependingValues" type="list" default="['--- None ---']" description="to store dependent field values"/>
<aura:attribute name="depnedentFieldMap" type="map" description="map to store dependent values with controlling value"/>
<aura:attribute name="bDisabledDependentFld" type="boolean" default="true"/> 

<aura:attribute name="objDetail" type="contact" default="{'sobjectType' : 'case'}"/>
<aura:attribute name="controllingFieldAPI" type="string" default="RFI_Type__c" description="store field API name of Controller field"/>
<aura:attribute name="dependingFieldAPI" type="string" default="RFI_SubType__c" description="store field API name of dependent field"/>

<!--Controller Field-->
<lightning:layoutItem size="12" padding="around-small">    
    <lightning:select name="controllerFld"
                      value="{!v.objDetail.RFI_Type__c}"
                      label="RFI Type"
                      onchange="{!c.onControllerFieldChange}" aura:id="RFITypeValue" required="true" messageWhenValueMissing="Choose RFI Type Value!">
        <aura:iteration items="{!v.listControllingValues}" var="val">
            <option value="{!val}">{!val}</option>
        </aura:iteration>
    </lightning:select>
</lightning:layoutItem>

<!--Dependent Field-->
<lightning:layoutItem size="12" padding="around-small">
    <lightning:select name="dependentFld"
                      value="{!v.objDetail.RFI_SubType__c}"
                      label="RFI SubType"
                      disabled="{!v.bDisabledDependentFld}" required="true" messageWhenValueMissing="Choose RFI SubType Value!">
        <aura:iteration items="{!v.listDependingValues}" var="val" >
            <option value="{!val}">{!val}</option>
        </aura:iteration>
    </lightning:select>
</lightning:layoutItem>
<c:liu_NewRFIOnOpportunity aura:id="childCmp"/>
    <lightning:button variant="brand" label="Submit" onclick="{! c.handleClick }" />

3

You cannot put a custom button on your component along with the standard Cancel button as in your screenshot. The reason why the Cancel button is in there is because you are using force:lightningQuickAction interface here.

When used as actions, components that implement the force:lightningQuickAction interface display in a panel with standard action controls, such as a Cancel button. These components can display and implement their own controls in the body of the panel, but can’t affect the standard controls.


To resolve this (and how I have done in past), you should instead use force:lightningQuickActionWithoutHeader. This will ensure that the standard actions are not displayed.

When used as actions, components that implement the force:lightningQuickActionWithoutHeader interface display in a panel without additional controls.

You may though need to provide a custom Cancel action for Users.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.