+ Start a Discussion
anji punyamanthulaanji punyamanthula 

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

<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}" />
<lightning:input aura:id="date-StartDate" type="date" name="" label="" class="ltng-label-hide" value="{!v.sObject.Musqotmpm__StartDate__c}"                                                                                                                                                                                onchange="{!c.handlePeriod}" />

closeModal : function(component, event, helper) {
        component.set("v.hasErrors", false);
        //helper.readCustomField(component, event, helper);
        helper.hideModal(component, event, helper);
        //component.set('v.sObject', {});       
    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. 

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