building a single page app with lightning components
Post on 21-Mar-2017
896 Views
Preview:
TRANSCRIPT
Building a Single Page App with Lightning ComponentsMarch 15, 2017
Statement under the Private Securities Litigation Reform Act of 1995:
This presentation may contain forward-looking statements that involve risks, uncertainties, and assumptions. If any such uncertainties materialize or if any of the assumptions proves incorrect, the results of salesforce.com, inc. could differ materially from the results expressed or implied by the forward-looking statements we make. All statements other than statements of historical fact could be deemed forward-looking, including any projections of product or service availability, subscriber growth, earnings, revenues, or other financial items and any statements regarding strategies or plans of management for future operations, statements of belief, any statements concerning new, planned, or upgraded services or technology developments and customer contracts or use of our services.
The risks and uncertainties referred to above include – but are not limited to – risks associated with developing and delivering new functionality for our service, new products and services, our new business model, our past operating losses, possible fluctuations in our operating results and rate of growth, interruptions or delays in our Web hosting, breach of our security measures, the outcome of any litigation, risks associated with completed and any possible mergers and acquisitions, the immature market in which we operate, our relatively limited operating history, our ability to expand, retain, and motivate our employees and manage our growth, new releases of our service and successful customer deployment, our limited history reselling non-salesforce.com products, and utilization and selling to larger enterprise customers. Further information on potential factors that could affect the financial results of salesforce.com, inc. is included in our annual report on Form 10-K for the most recent fiscal year and in our quarterly report on Form 10-Q for the most recent fiscal quarter. These documents and others containing important disclosures are available on the SEC Filings section of the Investor Information section of our Web site.
Any unreleased services or features referenced in this or other presentations, press releases or public statements are not currently available and may not be delivered on time or at all. Customers who purchase our services should make the purchase decisions based upon features that are currently available. Salesforce.com, inc. assumes no obligation and does not intend to update these forward-looking statements.
Forward-Looking Statement
Go Social!
@salesforcedevs
Salesforce Developers
Salesforce Developers
Salesforce Developers
This webinar is being recorded! The video will be posted to YouTube and thewebinar recap page (same URL as registration).
Have Questions?• Don’t wait until the end to ask your question!
— Technical support will answer questions starting now.
• Stick around for live Q&A at the end — Speakers will tackle more questions at the end, time-
allowing. • Head to Developer Forums
— More questions? Visit developer.salesforce.com/forums ?
Agenda
1. Intro: SendOffer LC2. Single-Page Application (SPA)3. Lightning Base Components4. Lightning Events & CSS5. Dynamic creation of Lightning Components6. Demo7. Resources
SendOffer Lightning Component
1. We built a Recruitment Application that handles candidates, interviews, and offers.
2. SendOffer LC provides an easy way to construct and send offer letter to candidate
3. 4 Stages: Detail, Edit, Review, Send
Single Page Application (SPA)
1. Does not require page reloads to work
2. Faster than Page-Centric Apps
3. Usually built with Javascript, CSS, Ajax
4. Examples: Salesforce Lightning Experience, Salesforce 1
Send Offer LC (SPA)
OfferLetterSPA.cmp
Lightning Base Components
1. Built in on the platform- No more html + SLDS + javascript work
2. Lightning:Input
3. Lightning:Select
4. Lightning:Icon
5. Lightning:TextArea
6. Lightning:button
Lightning Events & CSS
1. Application Events
- passing data between children
2. Component Events & CSS
- bubbling - show and hide children Components
Dynamic Creation of LCs
1. Gives you more flexibility
2. Define which child LCs and which attributes should be
created based on - data (eg. list row should show as read-only or not)- user interaction (eg. add error messages
dynamically based on validation checks)
Demo
OfferLetterSPA.cmp (Parent)
OfferDetails.cmpOfferTemplate.cmp
Component Events
Offer_Details_N
ext
Offer_Template_
Next
OfferPreview.cmp
Application Events
OfferTemplate (child 2)
OfferPreview (child 3)
OfferDetails (child 1)
OfferConfirm (child 4)
OrgCandidateDetailEvent.evt———————————
• CandidateID• E-Mail• Salary• Bonus• TemplateID• OfferId• OfferLetter
CandidateDetailEvent.evt———————————
• CandidateID• E-Mail• Salary• Bonus• TemplateID• OfferId• OfferLetter
LightningFramework
LightningFramework
CandidateDetailEvent.evt———————————
• CandidateID• E-Mail• Salary• Bonus• TemplateID• OfferId• OfferLetter
CandidateDetailEvent.evt———————————
• CandidateID• E-Mail• Salary• Bonus• TemplateID• OfferId• OfferLetter
Org
Dynamic Creation of LCs
List.cmpListController.js
<apex:Component>
<div>
{!v.Body}
</div>
</apex:Component>
// JS Controller:
//Loop
for (i = 0; i < list.length; i++) { if (i.isReadOnly){
// Create Row Component without Edit Link
} else
// Create Row Component with Edit Link}
Resources
1. Lightning Base Components (Link)
2. Lightning Events (Link)
3. Show/Hide Markup with CSS (Link)
4. Dynamic creation of LCs (Link)
5. Github (Link)
#forcewebinar
Deploying Your Code
SurveyYour feedback is crucial to the successof our webinar programs. Thank you!
https://sfdc.co/singlepagelightning
Q&ATry Trailhead: trailhead.salesforce.comJoin the conversation: @salesforcedevs
Thank You
top related