This post is again as per request from one of my friend .He wanted me to put together a simple demonstration of how to handle lightning events from visualforce and how to publish or fire lightning events from outside salesforce .Both of these cases are extremely common if you are building application using lightning for visualforce .
If you have already started adopting Lightning component framework ,you probably know how important are Events .There are two types of events , Application events and Component Events .Please note that prerequisite for understanding this blog is understanding of events in context of lightning component framework .
The below code snippets apply to only application events .
Application events are handled by all components that are listening to the event. These events are essentially a traditional publish-subscribe model.
Now this opens a world of new opportunities to mash up already existing visualforce UI with lightning component framework.
One sample project that i experimented is in my git repo which takes map component as a lightning component but receives pickers from the visualforce select option .
I hope this opens up a whole world of new directions to design and build some excellent mashups with visualforce and lightning .
Please reach out via my twitter @msrivastav13 or mail msrivastav13@gmail.com.
If you have already started adopting Lightning component framework ,you probably know how important are Events .There are two types of events , Application events and Component Events .Please note that prerequisite for understanding this blog is understanding of events in context of lightning component framework .
The below code snippets apply to only application events .
Application events are handled by all components that are listening to the event. These events are essentially a traditional publish-subscribe model.
1. Firing Events from the Visualforce and Handling the Events in lightning components
To demonstrate this ,lets create a simple event file and fire the event from the visualforce inside the callback and handle the event back in the lightning component file
Below is the component set up for lightning framework
Lets put together the visualforce code needed for the experiment
Here are the exciting resultsNow this opens a world of new opportunities to mash up already existing visualforce UI with lightning component framework.
One sample project that i experimented is in my git repo which takes map component as a lightning component but receives pickers from the visualforce select option .
2.Firing events from the lightning component and handling the event inside visualforce
This is another interesting observation ,you can fire an event from the lightning component and handle the event inside visualforce .
Lets see the hello world code for this scenario
The visualforce code is as below
Fun part
I hope this opens up a whole world of new directions to design and build some excellent mashups with visualforce and lightning .
Please reach out via my twitter @msrivastav13 or mail msrivastav13@gmail.com.
You have written a very effective blog for readers, thank you so much to share this useful information. If you want best Trucking Insurance in US then you should visit our website.
ReplyDeleteGreat post friend, Thank a lot to share this. You are doing good job. Keep posting.
Salesforce Consulting India
This comment has been removed by the author.
ReplyDeleteThanks for sharing, nice post! Post really provice useful information!
ReplyDeleteHương Lâm chuyên cung cấp bán máy photocopy và dịch vụ cho thuê máy photocopy giá rẻ, uy tín TP.HCM với dòng máy photocopy toshiba và dòng máy photocopy ricoh uy tín, giá rẻ.
ReplyDeleteNice Blog With Full of Knowledge Thanks For Sharing.
UI Development Training
UI Development Training in Hyderabad
UI Development Online Training
This comment has been removed by the author.
ReplyDeleteYes i am totally agreed with this article and i just want say that this article is very nice and very informative article.I will make sure to be reading your blog more. You made a good point but I can't help but wonder, what about the other side? !!!!!!Thanks via4d
ReplyDeleteI was surfing the Internet for information and came across your blog. I am impressed by the information you have on this blog. It shows how well you understand this subject. via4d
ReplyDeleteNice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. via4d
ReplyDeletePHP Training in Chennai | Certification | Online Training Course | Machine Learning Training in Chennai | Certification | Online Training Course | iOT Training in Chennai | Certification | Online Training Course | Blockchain Training in Chennai | Certification | Online Training Course | Open Stack Training in Chennai |
ReplyDeleteCertification | Online Training Course
http://www.happierit.com
ReplyDeletehttp://www.happierit.com
http://www.happierit.com
http://www.happierit.com
http://yaando.com/
[no anchor text]
[no anchor text]
click here to visit the site
Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post.
ReplyDeleteevent
Thanks a lot for sharing a valuable blog on Salesforce lightning. I was browsing through the internet looking for salesforce lightning and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject, you can find more information about Salesforce lightning here:
ReplyDeleteSalesforce lightning interview questions and answers
Salesforce lightning
"""Dear Admin,
ReplyDeleteI am Universal Investment Strategies. Very informative post! I am thankful to you for providing this unique information.
Universal Investment Strategies provides one-on-one options trading mentorship and education to investors seeking to generate active, passive and/or retirement income. With over 25 years of combined experience and thousands of satisfied customers, Universal Investment Strategies was founded on the principals of we will walk with you side by side every step of the way.
Universal Investment Strategies LOS ANGELES CA
Online Stock Trading
Best Options To Trade
Learn How To Trade Stocks
Best Trading Courses
Best Way To Learn Stock Trading"""
ReplyDeleteThanks, this is generally helpful.
Still, I followed step-by-step your method in this salesforce cpq online training
salesforce cpq course