on 04-11-2008 2:26 PM
hi,
I want to transfer attribute values of context node in view controller to the attribure of context in component controller at runtime (without creating context mapping at design time).
Is it possible ? If yes, let me know how to implement this.
Hello,
Yes, it's possible, you can do the following:
DATA: lr_view_context TYPE REF TO if_wd_context_node,
lr_comp_control TYPE REF TO if_wd_component,
lr_cont_context TYPE REF TO cl_wdr_controller,
lr_context TYPE REF TO if_wd_context_node,
lv_carrid TYPE sflight-carrid.
lr_view_context = wd_context->get_child_node( name = wd_this->wdctx_bapisblist ).
IF lr_view_context IS NOT BOUND.
RETURN.
ENDIF.
lr_view_context->get_attribute( EXPORTING name = `CARRID` IMPORTING value = lv_carrid ).
lr_comp_control = wd_comp_controller->wd_get_api( ).
TRY.
lr_cont_context ?= lr_comp_control->get_context( ).
CATCH cx_sy_move_cast_error.
RETURN.
ENDTRY.
lr_context = lr_cont_context->if_wd_context~root_node.
lr_context->set_attribute( name = `CARRID` value = lv_carrid ).
In this example, the component controller has only attributes.
Regards.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
87 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.