You need to sign in to do that
Don't have an account?
Muhammad umer
Getting Input values of Strike Input Component in a Parent Controller
I am using Strike Input component as child componet to capture Input Field as below:
Now in the parent component controller i want to get the value of this input user entered but i am not sure how can i do it. I have registered to an event in the parent component like below:
Please need help on this.
<c:strike_input auraId="groupName" value="{!v.group.Name}" type="text" name="Name" label="Group Name" errorMessage="Invalid Group Name"/>
Now in the parent component controller i want to get the value of this input user entered but i am not sure how can i do it. I have registered to an event in the parent component like below:
<aura:handler name="onchange" event="c:strike_evt" action="{!c.strikeInputChanged}" />And in the parent controller:
strikeInputChanged: function(component, event, helper) { var groupObj = component.get("v.groupData"); groupObj.GroupName = component.find("inputField").get("v.value"); component.set("v.groupData", groupObj); },But component.find("inputField").get("v.value") is returning null.
Please need help on this.
Since strike already defined an on change event: you can just use it like this: And catch the events Element to get its value like this: Hope this helps.
Kindly mark this as solved if it's resolved so that it gets removed from the unanswered queue which results in helping others who are encountering a similar issue.
Thanks,
Nagendra