function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
Peter BölkePeter Bölke 

Changing Title/header on Modal

Hello,

i have created lighting quickaction. Can anyone tell me how i can change the title/header of the appearing modal? I need to have it different from the label i have specified for the button.

thanks
Peter
Best Answer chosen by Peter Bölke
GhanshyamChoudhariGhanshyamChoudhari
I believe it not possible have different label and header. 

All Answers

GhanshyamChoudhariGhanshyamChoudhari
Hi Peter ,

try below code
 
<section class="slds-modal slds-fade-in-hide slds-modal_large" aura:id="someid">
        <div class="slds-modal__container">
            <header class="slds-modal__header">
                <button class="slds-button slds-button_icon slds-modal__close slds-button_icon-inverse btn-icon-white" onclick="{!c.fireclose}" title="Close">
                    <lightning:icon class="slds-input__icon" iconName="utility:close" size="small"/>
                    <span class="slds-assistive-text">Close</span>
                </button>
                <h2 class="slds-text-heading_medium slds-hyphenate" title="My Custom header">My Custom header</h2>
            </header>
            <div class="slds-modal__content"><!-- YOUR BODY goes here  -->
			</div>
        </div>
    </section>

 
Peter BölkePeter Bölke
Thanks for your quick reply.


I added your code to my component
 
<aura:component implements="force:lightningQuickAction,force:hasRecordId" access="global" controller="CtrlGetDocumentidBtn">
    <aura:attribute name="recordId" type="Id" />
    <aura:attribute name="Filename" type="String" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:attribute name="document_header__c" type="Document_Header__c" 
                    default="{ 'sobjectType': 'Document_Header__c' }"/>
    <aura:handler event="force:refreshView" action="{!c.doInit}" />
    <section class="slds-modal slds-fade-in-hide slds-modal_large" aura:id="someid">
        <div class="slds-modal__container">
            <header class="slds-modal__header" title="My Custom header">

                <h2 class="slds-text-heading_medium slds-hyphenate" title="My Custom header">My Custom header</h2>
            </header>
            <div class="slds-modal__content"><!-- YOUR BODY goes here  -->
            </div>
        </div>
    </section>
</aura:component>
But the modal still shows the label. 
 
GhanshyamChoudhariGhanshyamChoudhari
above code show us you are creating quick action.
for the quick action, you need not create a model because once you click on action button system will automatically populate model for you.
If you want to change the label of header then go to action button, edit button and change label to what you want your label. so it will reflect in your model
 
Peter BölkePeter Bölke
Actually i want to have the label and the header of the model to be different. :)
GhanshyamChoudhariGhanshyamChoudhari
I believe it not possible have different label and header. 
This was selected as the best answer