Sunday 28 February 2016

Lightning Events Via Visualforce

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.


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 results











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 .


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.

65 comments:

  1. This comment has been removed by the author.

    ReplyDelete
  2. Thanks for sharing, nice post! Post really provice useful information!

    Hươ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ẻ.

    ReplyDelete
  3. This comment has been removed by the author.

    ReplyDelete
  4. I 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

    ReplyDelete
  5. Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post. via4d

    ReplyDelete
  6. Nice post! This is a very nice blog that I will definitively come back to more times this year! Thanks for informative post.
    event

    ReplyDelete
  7. 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:
    Salesforce lightning interview questions and answers
    Salesforce lightning

    ReplyDelete
  8. """Dear Admin,
    I 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"""

    ReplyDelete

  9. Thanks, this is generally helpful.
    Still, I followed step-by-step your method in this salesforce cpq online training
    salesforce cpq course

    ReplyDelete
  10. 360 Degree Cloud being the Salesforce registered consulting and ISV Partner provides you with the best services on the global level. Unleash the power of Salesforce Consultancy with the help of 360 Degree cloud and explore the infinite pool of opportunities.

    visit-360degreecloud

    ReplyDelete
  11. This comment has been removed by the author.

    ReplyDelete
  12. The biggest asset of any company these days is its customers. If you have no customer to buy your product, your business will not succeed.

    Visit: customer journey mapping examples

    ReplyDelete
  13. Thanks for sharing best information. I am really enjoying reading your well written post.

    Ksalol Xanax 1MG (Alprazolam) tablets online

    Diazepam 10mg Tablets UK

    ReplyDelete
  14. Thanks for sharing the post! Get your medicine to treat insomnia at your doorstep. For your next purchase of Zopiclone Tablet, do market research in advance to get the best quality medicine.

    ReplyDelete
  15. I felt the information provided in this blog is really valuable for people ............. Thanks for sharing such an informative blog.
    pregabalin tablets
    Xanax Pill

    ReplyDelete
  16. Male sexual problems such as impotence or erectile dysfunction has gained prominence all over the world. Buy levitra 10 mg online There are innumerable men who complain about having a problem of impotence. Due to this problem, they are unable to perform sexual activities

    ReplyDelete
  17. Wonderful post. It’s very useful for me and I am very much impressed with your meaningful thoughts.

    Zopiclone Tablets Next Day Delivery UK
    Zopiclone Tablets White UK
    Zopiclone Tablets blue UK

    ReplyDelete
  18. Order online pills safely & securely With guaranteed Next Day Delivery in UK from Zopiclone Next Day Delivery.

    HAB Pregabalin 300mg Tablets
    Ksalol Xanax 1MG tablets

    ReplyDelete
  19. Thank you very much for sharing this informative blog with us, Really amazing post.

    anxiety pills
    anti anxiety tablets
    anxiety attack pills

    ReplyDelete
  20. Great information, keep it up. Buy Zopiclone online to get proper sleep at night. Visit http://onlinepillshoprx.com/product/zopiclone

    ReplyDelete
  21. Awesome Article Thanks for sharing your valuable information are you looking for a mern stack development company from Technoduce to meet your business requirement on development, customization, designing, migration, maintenance, revamping, etc.

    ReplyDelete
  22. This comment has been removed by the author.

    ReplyDelete
  23. Very Nice Informative Blog Thanks !
    Armodafinil Waklert 150Mg is commonly prescribed for the treatment of narcolepsy, a neurological disorder characterized by excessive daytime sleepiness and sudden episodes of muscle weakness (cataplexy). It is also used to treat other sleep-related disorders such as obstructive sleep apnea and shift work sleep disorder.

    ReplyDelete
  24. "Thanks for sharing this valuable content!
    The main function of Kamagra Gold 100MG Tablet (sildenafil citrate) is to increase blood flow to the penis, which helps men achieve and sustain an erection during sexual stimulation. It works by inhibiting the action of the enzyme PDE5, which can constrict blood vessels in the penile area.

    ReplyDelete
  25. I meant to say!
    If you have issues of narcolepsy or obstructive sleep apnea or other sleeping disorders, Modafinil 200 mg tablet would be the best medicine for the treatment. Follow the prescription of your doctor to get the best results.

    ReplyDelete
  26. Very Nice Informative Blog Thanks !
    Do you have moderate to severe pain? Treat it with doses of Tapentadol 100mg tablet You can buy this medicine with Meddy Shop, USA and get it delivered to your doorstep in 10-15 working days across the USA. We provide the best healthcare service.

    ReplyDelete
  27. I meant to say!
    The "oral jelly" form of Kamagra 100MG is different from traditional tablets or pills. It comes in a gel-like form that is easier to swallow, and it may be available in various flavors.

    ReplyDelete
  28. "Thanks for sharing this valuable content!
    Modafinil 200MG Tablets is a medication that is primarily used to treat narcolepsy, a disorder characterized by excessive daytime sleepiness and sudden sleep attacks. It is also prescribed to individuals with other sleep disorders like obstructive sleep apnea and shift work sleep disorder, which can disrupt normal sleep-wake patterns.

    ReplyDelete
  29. I meant to say!
    Tramadol 50Mg is a artificial opioid pain drug harnessed to swing moderate to pretty hard pain. It's generally defined after surgeries, for habitual pain provisions, or for other stories wherenon-opioid pain relievers aren't sufficient.

    ReplyDelete
  30. Very Nice Informative Blog Thanks !
    Kamagra Polo 100MG The medication works by increasing blood flow to the penis, helping men achieve and sustain an erection when sexually stimulated.

    ReplyDelete
  31. "Thanks for sharing this valuable content!
    Tramadol 100 mg tablet helps you treat moderate to severe pain in the body effectively. Use this medicine as prescribed by your doctor, and get the best result for your pain issues. Buy this medicine from Meddy Shop, USA at a nominal price.

    ReplyDelete
  32. Very Nice Informative Blog Thanks !
    Go for Suhagra 100 mg Tablet, it's a tremendous alternative to Viagra and costs you much less than any kind of ED medicine. Get your partner satisfied in bed for now and ever.

    ReplyDelete
  33. I meant to say!
    Vidalista 40 mg tablets is a artificial opioid pain drug harnessed to swing moderate to pretty hard pain. It's generally defined after surgeries, for habitual pain provisions, or for other stories wherenon-opioid pain relievers aren't sufficient.

    ReplyDelete
  34. "Thanks for sharing this valuable content!
    <a href="https://medy24x7.com/product/tramadol-200mg/>Tramadol 200 mg tablet</a> is a synthetic opioid drug used to treat moderate to relatively severe sting. It's frequently specified whennon-opioid sting specifics like acetaminophen or nonsteroidalanti-inflammatory medicines( NSAIDs) aren't effectual sufficiently. Tramadol 200MG workshop by manacling to opioid receptors in the genius, which helps to disrate the feeling of sting.

    ReplyDelete
  35. Very Nice Informative Blog ! excellent job.
    Sunrise Beauty Spa is a premier destination for ultimate relaxation and self-care. Our dedicated team of skilled professionals offers a wide array of indulgent spa services, from soothing massages to revitalizing facials and exquisite body treatments.

    ReplyDelete
  36. Great information, keep it up.
    Vidalista black 80mg tadalafil is well-known medicine for treating erectile in men. If yyou have similar issues, take your treatment of tadalafil-powered Vidalista and enhance your sex capacity in bed. You should consult a doctor before consuming it.

    ReplyDelete
  37. Great information, keep it up.
    Are you looking for a trusted medicine for erectile dysfunction, there could be nothing better than to Buy Vilitra 60 mg for your male impotence issues. Unsatisfied sexual experience can be troubleshot with this trusted drug from ED. Get it from Meddy Shop, USA at the best available price.

    ReplyDelete
  38. Thanks for sharing best information.
    Armodafinil 150mg tablet helps in the treatment of daytime excessive sleepiness and other sleep disorders such as cataplexy (total or partial loss of muscle control), obstructive sleep apnea, and sleep paralysis. Narcolepsy (excessive daytime sleepiness) is a disorder for sleep that influences the daytime work schedule and also in turn affects the normal sleep cycle.

    ReplyDelete
  39. Thank you very much for sharing this informative blog with us, Really amazing post.
    Lyrica 300 mg online is an antiepileptic and anticonvulsant drug. The active element of the drug is pregabalin, which inhibits the motion of calcium into the cells of neurons in reaction to the implicit action. Pregabalin is portrayed by a high bent to nascence-2-delta protein, extant in the medial nervous system apkins.

    ReplyDelete
  40. Very Nice Informative Blog ! excellent job.
    Find effective pain relief with Tramadol 100 mg TabletsBuy these reliable medications online to manage moderate to severe pain effectively. Tramadol 100 mg Tablets onlineworks by altering the way your body senses and responds to pain, providing fast-acting relief.

    ReplyDelete
  41. At Buy Online tapentadol we understand the importance of your health and well-being. That’s why we strive to provide you with easy access to high-quality medications, healthcare products, and essential health information, all from the comfort of your own home.

    ReplyDelete
  42. Hey You're doing great work for us, I mean just look at this what a great article you shared for us, Seriously thanks for this.
    ativan 2mg
    alko 1 mg
    fildena 50
    clonazepam 2mg
    lypin 10 mg
    pain o soma 500mg
    vigora tablet 100mg
    kamagra 50mg
    cenforce 50 mg

    ReplyDelete
  43. Employing a remote Salesforce developer from the UK gives you access to a pool of skilled people who know how to make the most of Salesforce's features. Make sure to carefully check candidates' qualifications, project experience, and communication abilities.

    hire remote salesforce developer UK

    ReplyDelete
  44. Find the best painkiller tablets in the UK at Ready To Calm. Affordable Painkiller Tablets UK with next day delivery. Shop Now online for fast pain relief now.
    Buy Tramadol 100mg Tablets Uk
    Buy Pregabalin
    buy Rivotril Tablet UK online
    buy sildamax online uk

    ReplyDelete
  45. Efficiency at its best! Citrix seamlessly streamlines communication, increases productivity, and maintains data security.
    citrix companies

    ReplyDelete
  46. Your generosity in sharing this is greatly appreciated. Thank you!

    Buy Diazepam Terapia 10mg UK



    ReplyDelete
  47. Your post was really helpful. Thanks for sharing it!

    Ksalol Xanax 1MG (Alprazolam)

    ReplyDelete
  48. Great post! Your insights were exactly what I needed.

    Buy Diazepam Terapia 10mg UK

    ReplyDelete

Introducing Lightning Base Components

Lightning Base Components are great addition to the platform and in fact revolutionary .One of the concerns around lightning component ...