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
sheila srivatsavsheila srivatsav 

Aura.Action issue

I am trying to understand the basic concept of Aura.Action in lightning but stuck with an error.
ChildComp.cmp

<aura:component >
    
    <aura:attribute name="childTitle"
                    access="global"
                    default="Default Child Title"
                    type="string"/>
    
    <aura:attribute name="onParentClick"
                    type="Aura.Action"/>
    <lightning:layout>
    
    <lightning:layoutItem>
          <div class="header-column">
                    <p class="field-title" title="Child Title Is">Child Title</p>
                    <p>{!v.childTitle}</p>
                </div>
                <div>
                  <lightning:input type="text"
                                   label="Enter some value..."
                                   aura:id="inputChildTitle"
                                   disabled="true"/>
                    
                </div>
        <lightning:button label="Change My Title"
                          onclick="{!c.ChangeTitle}"/>
        
        <!-- Create a button here -->
             <lightning:button label="Enable Child TextBox"
                               onclick="{!v.onParentClick}"/>
        </lightning:layoutItem>
    </lightning:layout>
    
	
</aura:component>

ChildCompController.js

({
	ChangeTitle : function(component, event, helper) {
        component.set("v.childTitle","Changed Title From Child Itself");
	}
})


ParentComp.cmp

<aura:component >
	
  <aura:attribute name="parentTitle"
                    access="global"
                    default="Default Parent Title"
                    type="string"/>
    
     <lightning:layout>
    
    <lightning:layoutItem>
          <div class="header-column">
                    <p class="field-title" title="Parent Title Is">Parent Title</p>
                    <p>{!v.parentTitle}</p>
                </div>
                
         </lightning:layoutItem>
    </lightning:layout>
    
    <c:ChildComp aura:id="childCmp"
                  onParentClick="{!c.EnableTextBox}"/>  
</aura:component>

ParentCompController.js

({
	EnableTextBox : function(component, event, helper) {
		
        debugger;
        //Now find the textbox which is defined in child comp
        var inputChildTitle=component.find("inputChildTitle");
        
        console.log("inputChildTitle="+inputChildTitle);
        
        inputChildTitle.set("v.disabled",false);
	}
})
The error is in the statement  " inputChildTitle.set("v.disabled",false);"

Please help me 

thanks
sheila
 
Jolly_BirdiJolly_Birdi
Hello @Sheila

I am not sure but can you please try it with this

inputChildTitle.set("v.disabled","false");

Please like and mark this as best if you find it helpful.


Thanks
Jolly Birdi
Raj VakatiRaj Vakati
Please refer this link where i explained it clearly 

https://rajvakati.com/2018/01/02/lightning-aura-action-attributes/