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
anji punyamanthulaanji punyamanthula 

Lightning:input values are not getting refreshed when we are cancel it

Component-Markup:
<div class="slds-form-element__control">
<div class="uiInput uiInputDate uiInput--default uiInput--input uiInput--datetime">
             <label class="label inputLabel uiLabel-left form-element__label uiLabel">
              <span class="">{!v.customField.musqotmpm__startdate__c.Label}</span>
              <span class="required ">*</span>
      <aura:if isTrue="{!!empty(v.customField.musqotmpm__startdate__c.InlineHelpText)}">
     <lightning:helptext content="{!v.customField.musqotmpm__startdate__c.InlineHelpText}" />
         </aura:if>
           </label>
<lightning:input aura:id="date-StartDate" type="date" name="" label="" class="ltng-label-hide" value="{!v.sObject.Musqotmpm__StartDate__c}"                                                                                                                                                                                onchange="{!c.handlePeriod}" />
                                                                                    </div>
                                                                                </div>

Component:Js:
closeModal : function(component, event, helper) {
        component.set("v.hasErrors", false);
         $A.get('e.force:refreshView').fire();
        //$A.get("e.force:closeQuickAction").fire();
        //helper.readCustomField(component, event, helper);
        //document.location.reload(true);
        helper.hideModal(component, event, helper);
        //component.set('v.sObject', {});       
        if(!component.get('v.fromPlan')){
            window.history.back();
        }
},
    User-added image
Naveen KNNaveen KN
Hi Anji, 

I see that you are refreshing the view on close of modal window, I think that is not required as you are not doing any DML operation on close. If you are looking to nullify the input fields, then you have to add code to nullify the object in the closemodal method of component js. 

I am adding code to nullify the date field below
closeModal : function(component, event, helper) { 
component.set("v.sObject.Musqotmpm__StartDate__c", "");
}

Add this line of code to your method and verify the functionality. you can nullify the entire object in the form instead of a single field, which is a good approach. 

component.set("v.sObject", "");

Please test and share the results. 

Naveen
Team codengine.in
anji punyamanthulaanji punyamanthula
Its not working .I have setted like component.set("v.sObject", ""); but its not
Naveen KNNaveen KN
Try this one component.set("v.sObject", null); 
Evelyn HowardEvelyn Howard
I guess its an browser proble, coding wont work.Try in different .https://www.mybkexperience.reviews/ browser