cancel
Showing results for 
Search instead for 
Did you mean: 

Call an action From Other View

Former Member
0 Kudos

Hi all,

I have two views view1 and view2. View1 also have an action Action1, View2 have Action2. I wanna call Action1 from view2(action2) . Is it possible ? How can i do that ? View1 and view have different contexts.

Regards,

Orhan

Accepted Solutions (0)

Answers (4)

Answers (4)

Former Member
0 Kudos

no helpful result.

former_member1151507
Participant
0 Kudos

Hi,

It is not possible to call methods of one view from another. If you need to use same method in more than one view, create the method in COMPONENTCONTROLLER.

Regards,

Manogna

Former Member
0 Kudos

Hi,

I doubt if it is possible to call a view's action from another view.(may be there is a way , but I do not know)

As a workaround , you can create a component controller method with the code same as in your View1 's action handler code

and call it from your second view.

Cheers,

Aditya.

Madhu2004
Active Contributor
0 Kudos

Hi,

You cannot call methods of a view from different view.Create wrapper method in component controller and call the same from the view method.

Madhu

Former Member
0 Kudos

Hi,

But they have different contextes.

Former Member
0 Kudos

Hi,

Create the context in component controller first and then map it to the view.

Do the same for both views.

Now, your component controller mathod has access to both the context's..

Aditya.

Former Member
0 Kudos

there are lots of contextes i need to find a different way.

Former Member
0 Kudos

Hi,

Hmm in that case , in your action handler of View 1 , read all the context's needed for your component controller method(action handler of view 2) and pass this as exporting paramaters and get these values (changed values) as importing paramaters from Comp controller method and then set the context using these values.

Too much work though..:)

Thanks,

Aditya.

thomas_jung
Developer Advocate
Developer Advocate
0 Kudos

>

> there are lots of contextes i need to find a different way.

You have to consider that you are likely designing your Web Dynpro Components incorrectly. If you have large views with large local contexts then these should probably be separate Web Dynpro Components. Otherwise your views should be largely empty, delegating most of their processing to the component controller so that cross view data and eventing is handled there.

Former Member
0 Kudos

In fact, this is not the dynpro that i wrote. i here for some corrections. but you r right the dynpro at here is so bad designed.

Closed Topic .

Reason: Here is istanbul, no way out.

Edited by: goktasor on Sep 14, 2010 2:35 PM