cancel
Showing results for 
Search instead for 
Did you mean: 

Access the Webdynpro view method in a badi

Former Member
0 Kudos

Hi All,

The webdynpro component can be have mutliple views in it. And the  views will have the n number of methods accordingly.

My question is "Is there any way to access the method of the view in a badi ( outside the webdynpro ) ?

For ex : Webdynpro comp : "POWL_TABLE_COMP" has the view 'REFRESH_CONTENT' and this view has the method 'ONACTIONON_REFRESH_CLICKED'

Is it possible to access this method in a badi ??

Kindly share your ideas please!!!

Thanks,

Pradeep.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member211591
Contributor
0 Kudos

Hi Pradeep,

1. the complicated way:

To trigger the action ONACTIONON_REFRESH_CLICKED of your view, you have to do following:

you can implement an interface-method (within componentcontroller) for your component (which embeds your view). This interface method throws event Refresh_View which again is being handled within your view. This eventhandler finally calls ONACTIONON_REFRESH_CLICKED.

So theoretically you can call the interface-method from anywhere. But you need the reference to your "living" component-instance. Here is the problem. How do you know when calling the BADI at application layer, which instance is alive and which instance to call?

I would try this: Create a static class which which manages a list of references to the living components with methods add_instance(..), remove_instance(..) and get_instances(). Methods add_instance and remove_instance are called in webdynpro when creating and destroying your component.

The BADI then calles the interface-method of all references within the static-class (which it gets by calling get_instances()), when executed.

2. the easy way:

If you just want to refresh your view, you should consider to add UiElement TimmedTrigger, which just executes ONACTIONON_REFRESH_CLICKED after a certain amount of time (every 10 minutes). It is way more difficult to realize a refresh when needed (BADI has been called) from application layer with no connection to webdynpro.

PS: Way 1 is just an idea, I've never tried it, but maybe it works. Maybe a guru can tell us if this works or is a bad idea.

BR

ismail