on 03-17-2009 3:18 PM
Hi Experts
Could you please show me how to get component context from a view. I tried to access node from component context from a view but no success.
Thank you for you kindess
hi
In coding we can call the comonent controller
1.Component Controller Attributes Define Attribute name
comp_con type ref to IF_WD_CONTEXT_NODE. and make as public
2.Component Controller Init( ) method
wd_this->comp_con = wd_context.
For example i am just printing the message
Comp node name Sample and Attribute A1 type String .
3.In View Init ( ) we can call the context. and prinbting the Attibute
get message manager
DATA lo_api_controller TYPE REF TO if_wd_controller.
DATA lo_message_manager TYPE REF TO if_wd_message_manager.
data mes TYPE string.
lo_api_controller ?= wd_this->wd_get_api( ).
DATA lo_nd_sample TYPE REF TO if_wd_context_node.
DATA comp_context TYPE REF TO if_wd_context_node.
lo_nd_sample = wd_comp_controller->COMP_CON->get_child_node( 'SAMPLE' ).
lo_nd_sample->get_attribute( EXPORTING name = 'A1' IMPORTING value = mes ) .
CALL METHOD lo_api_controller->get_message_manager
RECEIVING
message_manager = lo_message_manager
.
report message
lo_message_manager->report_success( EXPORTING message_text = mes ) .
regards
Vivekananthan.S
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
If you want to use component controller context. drag component controller context to view controller context
other way: create the same node in view & right click on node & do data binding. between controllers.
Best Regards
Ravi
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
For accessing the component controller context,
firstly u have to map the context of component controller and view controller.
For this just go to the view controller context. Now in the right hand side u can see the component controller context.
Just drag and drop the node( which u want to use in view controller ) of component controller in view controller. U will get a pop up, now press yes. the complete node gets mapped to view controller and u can access this node as like the view context node.
Thanks,
Pankaj Aggarwal
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
map ur component controller context node to view controller cotext node . Access the attributes using
" WD_COMP_CONTROLLER ".
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Dean,
Just goto the View Context ,there you will seen on the right side the component controller context node.
Just drap and drop the node that you want in your view on the lefft hand side .
This will automatically create the mapping between the controller node.
Now you can access the node values in your view.
Hopes this will helps you.
Regards
Manoj Kumar
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
you cannot directly access the context of componentcontroller in View without mapping..
however there is a workaround, create a public attribute in the comopnent controller with name lr_context of type if_wd_context_node.
and in the WDDOINIT assign lr_context with WD_CONTEXT.
Now you can directly access lr_context from View. i think this is possible.
Abhi
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.