cancel
Showing results for 
Search instead for 
Did you mean: 

Call an action of an embedding view out of an embedded view

Former Member
0 Kudos

Currently I am working on a Web Dynpro ABAP application.

In every view of this application, there is a VIEWUICONTAINER-ELEMENT that integrates a different view.

When I click on a linktoaction or button of the embedded I can not navigate inside the application.

Example:

VIEW1 = embedding view with action = action1 (fire_to_view_xy_plg).

VIEW2 = embedded view in VIEW1 with a link to action ( in this link the action of VIEW1 should be called )

So is there the possibility to call an action of an embedding view out of an embedded view?

Regards.

Accepted Solutions (1)

Accepted Solutions (1)

ChrisPaine
Active Contributor
0 Kudos

Call action (handler) of view...

not really (as far as I know), call method of controller, yes (if it is public). The easier alternative is to have an event handler in the view which listens for a controller event, trigger the controller event (possibly via public method of the controller) and the view event handler is triggered and that can cause call the action handler method.

That said - why would you code like this? The view should be it's own self contained component (MVC) handling the view logic - if the logic should be exposed beyond that particular view, it should be implemented in the component controller. Instead code the embedded view to have a public component controller level method to implement the results of the action - this method could then be called from any other component. If you are trying to call a view method in a standard SAP view, there is probably a good reason that the logic of the action handler has not been exposed. You could expose it by enhancing the view and component controller as mentioned above, but I'd think that probably you shouldn't.

I guess this all comes down to how you design you code, and the particular use case that you have (of which I don't know) . I wouldn't recommend that approach to calling a view action handler, but it would depend on what you are trying to achieve.

Good luck, whichever way you decide to go/code.

Answers (0)