0% found this document useful (0 votes)
35 views1 page

Lighting Project Module

The document describes an Aura component that allows users to select a customer name, either 'Harry' or 'Potter', using buttons that trigger client-side controller functions. The component updates the displayed customer name based on the button pressed. It also explains the use of predefined Lightning components and the syntax for linking events to controller functions.

Uploaded by

nelavala_rajesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views1 page

Lighting Project Module

The document describes an Aura component that allows users to select a customer name, either 'Harry' or 'Potter', using buttons that trigger client-side controller functions. The component updates the displayed customer name based on the button pressed. It also explains the use of predefined Lightning components and the syntax for linking events to controller functions.

Uploaded by

nelavala_rajesh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd

Component:

<aura:component >
<aura:attribute name="CustomerName" type="String"/>
<div> Hello...{![Link]} </div>
<ui:button label="Select Harry" press="{![Link]}"/>
<ui:button label="Select Potter" press="{![Link]}"/>
</aura:component>

Client-side Controller:

({
ClickHarry : function(component, event, helper) {
[Link]("[Link]" , "Harry");
},
ClickPotter : function(component, event, helper) {
[Link]("[Link]" , "Potter");
},

})

Lightning App :

<aura:application >
<c:ClickComponent/>
</aura:application>

Explanation :
1.<ui:button> is one of the system�s pre-defined lightning component.
And we can feel free to use them. Once we have created a controller,
we can link the press event by using {!c.[eventName]} in the controller.

2. c. here means controller. And in this instance,


it means the client side controller file. And the eventName is the function name in
your Javascript code.

3. If you are familiar with html and javascript,


you shouldn�t find this piece of code too hard to understand.
And we have used [Link](�[Link]�, [value]); to update the attribute
value.

You might also like