cancel
Showing results for 
Search instead for 
Did you mean: 

Event handler

Former Member
0 Kudos

Dear Friends,

what is the purpose why you define an event in the component controller ?

Regrads

Ilhan Ertas

Accepted Solutions (1)

Accepted Solutions (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

Another feature is that of component usage. Components can be designed to be reused within other components. The best example of this is the implemenation of the ALV in Web Dynpro. It is a reusable component. You might want to let the parent component know about some event from within the inner reusable component. For that reason events in the component controller can be marked as interface events and can be exposed to external components. Once again this type of event is used heavily in the ALV component.

Answers (2)

Answers (2)

former_member40425
Contributor
0 Kudos

Hi,

Suppose You have created an event CLOSE_POPUP in component controller.

Now if you are creating a method of type event handler and suppose method name is POPUP_CLOSE. Now if you click F4 in coloumn event and select event as CLOSE_POPUP.

Now by firing this event you can call event handler method POPUP_CLOSE.

We can fire event in the following way.

wd_comp_controller->fire_CLOSE_POPUP_evt( ).

i.e. By firing event you can call any event handler method anywhere in code also.

I hope it helps.

Regards,

Rohit

uday_gubbala2
Active Contributor
0 Kudos

Hi Ilhan,

We can define events with arbitrary parameters for both component & custom controllers. Any method of any other controller (including view and window controllers) can register to these events if this method is defined as an event handler method.

A typical use of such events is the invocation of processing in a view controller after processing in the component controller has been completed. This can be achieved when a method in the view controller subscribes to an event raised by the component controller. Using your design time declarations, the Web Dynpro framework willautomatically manage the definition, triggering, and handler subscription to such events for you. However keep in mind that if two or more methods subscribe to the same event, the order in which they will be executed is undefined.

Regards,

Uday