cancel
Showing results for 
Search instead for 
Did you mean: 

Sending Events directly to a WD Component

Former Member
0 Kudos

Hi,

we have two Web Dynpro Components holding different Views and want to send an Event to the other component where a IWDConfirmationDialog is called and the answer has to be returned to the calling component view.

the difficulty is in getting back the answer to the calling view and determining the origin view in the interface controller of the calling component.

is there a way to send an event directly to an other wd component without going through the Interface Controllers?

Does the wdEvent Object hold any Information about the calling view?

It would be eligible if we could call a method in another dc and get the answer with ONE function call.

has anyone an idea?

Best Regards,

Norbert

Accepted Solutions (0)

Answers (2)

Answers (2)

Former Member
0 Kudos

Hi Norbert,

>

> It would be eligible if we could call a method in

> another dc and get the answer with ONE function

> call.

This is not possible, since displaying the confirmation dialog is one request/response cycle, user's confirmation of the dialog is the second. The application is not blocked like in Swing, if you display a modal dialog there.

Assuming the view controller V (calling the dialog) and the component DIA (providing the dialog) then one possible solution is:

1. DIA exposes a declared method void openDialog(String viewName) in it's component interface.

2. DIA exposes an event "DialogConfirmed" with a parameter "result" (choose the type of result as required) in it's component interface.

3. The component "owning" V declares a component usage to DIA.

4. V calls DIA's openDialog(wdControllerAPI.getName()).

5. V adds the component interface of DIA to it's required controller's list.

6. V subscribes via event handler method "handleDialogConfirmed(<type> result)" to DIA's DialogConfirmed event.

7. In the Action handler(s) of DIA, where the confirmation dialog actions are processed, the "DialogConfirmed" event of DIA is fired with the corresponding result.

This logic uses the component interface of DIA heavily, but this is the correct way for "inter-component" access, so there's no reason for not using the component interface for this purpose.

Hope that helps.

Best regards

Stefan

Message was edited by: Stefan Klensch

Former Member
0 Kudos

If you are running in the enterprise portal, you can use the WDPortalEventing API, which accomplishes this goal if both views are in the same page.

As of EP6 sp3, you can even send an event from an iframe to the container using the portal eventing API.

Former Member
0 Kudos

hi, thanks for that hint.

but we do not use the EP. Its a pure Web Dynpro Application in Netweaver Java.

Regards,

Norbert