cancel
Showing results for 
Search instead for 
Did you mean: 

How to call a component?

Former Member
0 Kudos

Hi,

i have two web dynpro components comp1 & comp2.

In comp1, i have one button 'submit'. when i click 'submit' button, it should navigate to comp2.

Moreover i need to pass two parameters to the comp2.

How to do? It will be helpful if anyone can assist.

Accepted Solutions (1)

Accepted Solutions (1)

shwetars
Advisor
Advisor
0 Kudos

Hi Mog,

you need to define a component usage of comp2. then within the main window of ur comp1 embed the view of comp2 to which you want to navigate.

create an outbound plug from view1 of comp1, this plug can have parameters that you need to pass.

view2 of comp2 also needs to have an inbound plug, in the signature of its handler method define the parameters you are passing from comp1.

under your window once view2 of comp2 is embeded create a navigation link between the two connecting views.

in the action handler for submit button in view1 just fire the outbound plug with appropriate parameters.

Regards,

Shweta

Former Member
0 Kudos

Hi,

I could understand partially, not fully.

where should i define component usage?

View or Window or Component of Comp1

How should i bind view of comp2 into window of comp1?

What code should i write within Onclick event of button?

To connect from comp1 -->comp2

Message was edited by:

Mog

Answers (1)

Answers (1)

Former Member
0 Kudos

Hi,

there are several ways of combining components.

One way might be to create a component MAIN_COMP which contains a view that provides a <b>ViewContainer-UI-Element</b>.

In the Window-Editor the relevant Interface Views of COMP1 and COMP2 can be added to the View of MAIN?COMP.

Passing data from COMP1 to COMP2 can be done

a) with plugs that do have parameters

b) by methods in the component controller that get/set data and also fire an event to which the view has subscribed

c) there is also context-mapping

I mostelz use b) but it depends on the scenario.

Kind regards,

Silke