• shaik israh
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies
Hi Team,
I am creating ContactSearchBar and ContactList as single component. On initialization of component am loading all the contacts to list after  in serach bar if i type any charachter am getting "Cannot read property 'value' of undefined"  error.Please find my snippet code
({
	doInit : function(component, event, helper) {
		  var action = component.get("c.findAllContactsList");
          action.setCallback(this, function(a) {
            component.set("v.Accounts", a.getReturnValue());
        });
        $A.enqueueAction(action);
	},
    ContactNameSearchKeyChange: function(component, event, helper) {
        var myEvent = $A.get("e.c:ContactSearchKeyEvent");
         
        myEvent.setParams({"searchKey": event.target.value});
        myEvent.fire();
          
    },
  
    ContactNameSearchKeyChange: function(component, event) {
    var searchKey = event.getParam("searchKey");
    var action = component.get("c.findByContactName");
    action.setParams({
      "searchKey": searchKey
    });
    action.setCallback(this, function(a) {
        component.set("v.contacts", a.getReturnValue());
    });
    $A.enqueueAction(action);
}
})