You need to sign in to do that
Don't have an account?
sheila srivatsav
Aura.Action issue
I am trying to understand the basic concept of Aura.Action in lightning but stuck with an error.
Please help me
thanks
sheila
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
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
https://rajvakati.com/2018/01/02/lightning-aura-action-attributes/