Salesforce

How Do I Handle Events Raised in a Hosting Application Using a Handler Defined in a Component? (Magic xpa 3.x)

« Go Back

Information

 
Created ByKnowledge Migration User
Approval Process StatusPublished
Objective
Description

How Do I Handle Events Raised in a Hosting Application Using a Handler Defined in a Component? (Magic xpa 3.x)

You can raise events in the host application, and have those events handled in the component. For instance, we could define an event to dial a phone number, and raise it in the host application when the user zooms on a phone number field.

There are three parts to this process. You need to:

  • Define the event in the component

  • Handle the event in the component

  • Raise the event in the host

These three steps are defined below.

Define the event in the component

  1. Enter the event in the Main program of the component. Make sure that Expose is checked, and that it has a public name.

  2. Choose the Event when you are creating the .eci.

Now, when you work with the component, you will be able to choose this event.

Raising the event in the host

  1. Go to the host program, to where you want to raise the event.

  2. Raise the event as you would any user event. The component event will show up in red, underneath the host’s own user events.

Handling the event in the component

  1. Go to the component.

  2. Go to the Main Program.

  3. Create the event handler for your event. Set the Scope to Global.

Now this handler will execute when the host program raises the event.

Reference
Attachment 
Attachment