• Shweta Hegde 5
  • NEWBIE
  • 0 Points
  • Member since 2019

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
Can anyone explain lead to cash business process ?
I am new to lightning components. Following is my code. When I run my code I am getting the Error
"Action failed: c:SearchBar$controller$SearchKeyChange [Cannot read property 'setParam' of undefined] Failing descriptor: {c:SearchBar$controller$SearchKeyChange}"

Please help me to resolve the issue.


// This is my Application

<aura:application>
         <div >
                <a href="#" >Lightning Contacts</a>
         </div>
    
         <div >
                <c:SearchBar/>
                <c:ContactList/>
         </div>
</aura:application>


//This is component

<aura:component >
    <input type="text" placeholder="Search" onkeyup="{!c.SearchKeyChange}"/>
</aura:component>


//This is controller
({
    
    SearchKeyChange : function(component,event, helper) {
        debugger;
        var myEvent=$A.get("e.c:SearcKeyChange");
        debugger;
        myEvent.setParam({"SearchKey":event.target.value});
        debugger;
        myEvent.fire();
       
    }
})


//This is Event

<aura:event type="APPLICATION" description="Event template" >
    <aura:attribute name="SearchKey" type="String"/>
    
</aura:event>

//This is another component

<aura:component controller="ContactController" >
    <aura:attribute name="contacts" type="Contact[]"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <aura:handler event="c:SearchKeyChange" action="{!c.SearchKeyChange}"/>
    <ul>
        <aura:iteration items="{!v.contacts}" var="contact">
            <li>
                <a href="{!'#contact/'+contact.Id}">
                    <p>{!contact.Name}</p>
                     <p>{!contact.Phone}</p>
                </a>
            </li>
        </aura:iteration>
    </ul>
</aura:component>
Can anyone explain lead to cash business process ?