Menu Close
    Start a Project Request quote Reading list Switch to dark mode
    marketplace-mod

    How to fire Lightning Event from Visualforce Page

    In this blog, we will learn how to fire lightning event from visualforce page. We will be using apex:includeLightning and aura:dependency tags. Let us proceed with knowing about these tags in brief.

    Tag Reference

    A brief information about tags.

    1) apex:includeLightning : It includes lightning components for Visualforce JavaScript library, lightning.out.js, according to the domain mapping.

    Attributes-
    –> id – An identifier to the element.
    –> rendered – Specifies if the element will be rendered or not. The default value is true.

    2) aura:dependency – This tag is used for declaring dependencies.

    Attributes-
    –> resource – The resource on which the dependency is being declared.
    –> type – The type of resource that component depends on. The default value is “COMPONENT”.

    Fire lightning Events in Visualforce Page

    Now, let’s start with the code. We have to fire an Event, so, first and foremost we will require an event. So, we will write a simple code for event containing single parameter, and event type should be “APPLICATION”:


    Now, let’s start with the app:


    We have to create a myDemoComponent which we have the dependency on, so here is the code:


    Now let’s call the use the App in Visualforce Page:

    Output

    Support

    That’s all for Remote Action function in Visualforce Page, still have any issue feel free to add a ticket and let us know your views to make the code better https://webkul.uvdesk.com/en/customer/create-ticket/

     

    . . .

    Comment

    Add Your Comment

    Be the first to comment.

    Back to Top
    css.php
    Hire Us!
    Brief us about your requirements and we'll get back to you.
    Woo! Hooy!
    We have just recieved your project brief and our expert will contact you shortly.
    Send Again
    Close

    Table of Content

    Hide Index