cancel
Showing results for 
Search instead for 
Did you mean: 

How subcontrollers talk to each other

daniel_humberg
Contributor
0 Kudos

I am using controllers and subcontrollers in my application. I like the concept very much.

Usually, my subcontrollers handle the events (e.g. button clicks) on their views themselves. But sometimes, a click in subcontroller 1 interests other subcontrollers. For example, I have "root.do" with 2 subcontrollers "toolbar.do" and "main.do". If a button in the toolbar is clicked, I would like to handle that event in "main.do".

What's the best way to do that?

Best regards,

Daniel

Accepted Solutions (0)

Answers (1)

Answers (1)

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

You could use ABAP OO events. You could define an event in the controller class for toolbar.do. When it receives the UI event from the MVC runtime it will then raise the ABAP OO event. main.do's controller class will then be registered with an event handler for that ABAP OO event.

Since root.do should have visibility to its subcontrollers (and their controller class instances), it could do the registration of the events.