cancel
Showing results for 
Search instead for 
Did you mean: 

How to fire an event or call a action with code?

J_B
Explorer
0 Kudos

Hy All,

i want to implement a scenario, where i jump fom another website into a webdynpro application.

This is a normal workflow with search - list - edit.

The search mask should be filled with parameters from outsite and the first site to display is the list.

I have read the document Inter-Application-Navigation. To get the parameters of the Request into my WebDynpro is ok, but on my scenario i have a problem to raise the event/action.

1. How can i trigger an event, like "Button Pressed" or value of field has changed?

or

2. How can i call a action like onActionSerach(event)

to fire my rfc-call to gelt the list of objects ?

Thanks for help!

by Jürgen

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi Jurgen

If I have understood you correct you want to initiate a search in webdynpro and show the result .And you want the webdynpro to be called from an external site via a redirect or when the webdynpro application is hyperlinked.And you also want the search criteria to be passed from the parent site depending on the business logic that has occured there.

One way to pass data from the external website to webdynpro is by passing parameters in the URL.

->Values for these parameters can be picked up by the Interface View of your component.

->If your Interface controller is added as one of the controllers for your Interface View. Then you can call a method in your Interface controller.

->You can define an event in your Interface controller that is registered by a method in your view(which displays results).

->On the call of the method in your Interface controller fire the event which will initiate action in the method you have defined in your View.

->The method in your view can be a call to SAP backend

Regards

Pran

J_B
Explorer
0 Kudos

Hy Pran,

that ist correct. You have understood the scenario.

If i call my site from an external Site (Browser) i got the parameters in the right field, but the problem is to fire the event to activate my action !

How can i co this ?

Do you have any example how it raise/trigger an event or is there a methode to call a action like onPlugFire....?

Regards

Jürgen

Former Member
0 Kudos

Hi Jürgen,

I hope i understand you right...

In this case, I would do the following:

Create a function/method which handels the thing you want to do (e.g. filling the list from backend)

Call this function from the action method of your search button AND from the place you get the parameters from the external App

I think calling the method wdThis.onActionYourAction(null) has the same result

Former Member
0 Kudos

Hi jurgen

-> Attach an event to a custom controller using the Events

property tab.

-> Link the custom controller to the view which show your

results.

-> Create a method in your view , while creation you can

select the event source. The event that you described

in the custom controller will be visible for you to

choose as the event source.

-> This means when the event in the custom controller is

triggered the method in the View is actioned.

-> You can code your backend call in the method that you

defined in your view

Regards

Pran