cancel
Showing results for 
Search instead for 
Did you mean: 

how to access the context elements across the different views

Former Member
0 Kudos

Hi

I have two views . one view contains input fields and the second contains a table which shows the result. I have a button in the first screen to trigger an action. now in the context of the first view I have two elemsnts and in the context of the second view I have the table node. In the action method of the button how do I access the table node of the second view. Or How do I access the two input elements in the first view in the methods of the second view. Both input fields and the table node exist in the cotext of the componentcontroller.

please advice.

thanks

sankar

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi snakar rao ,

You can move forward in three ways

1. on the button trigger of is view, using the code wizard you can read the input fields. and based on these values you can write logic to fetch data for the table node. once the data for the table node is fetched, you can bind the data to the table node

then write code for firing the outbound plug whixh is connected to the second view.

in this case you need to map both the nodes from component controller to view1.

2. on the action of button write code for firing the outbound plug whixh is connected to the second view.

then in wddoint of second view read the node thats mapped to the input field,and based on these values you can write logic to fetch data for the table node. once the data for the table node is fetched, you can bind the data to the table node.

in this case you need to map both the nodes from component controller to view1.

3. Best and Recommended

Create a method get_data in component controller

inside this method read the nodes thats binded to the input field,and based on these values you can write logic to fetch data for the table node. once the data for the table node is fetched, you can bind the data to the table node.

then on the button action of first view or on the do init of second view call this method.

Regards

Sarath

Edited by: Sarath Satheesan on Jan 8, 2008 12:29 PM

Answers (1)

Answers (1)

Former Member
0 Kudos

hi sankar.......

you have something called component controller. this acts as a global variable.

what you have to do is:

create the nodes for the input fields and the table in the component controller.

goto view 1 and drag the the node from teh component controller to thid view's context. now it is mapped.

the same for view2.

so at runtime you can read the values from these nodes and the values will be auto matically passed.

check this tutorial:

[tutorial|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/docs/library/uuid/02e1fa45-0801-0010-10a0-f1cf47e8c943 - ]

---regards,

alex b justin