on 08-19-2010 3:11 PM
Hi Experts,
is it possible in web dynpro to set eventhandlers on runtime like in "normal" ABAP?
There is the following scenario, I have dynamically embedded a component B in the component A and now I want to handle an event of component B in component A. I can't set the eventhandler on design time because the component usage doesn't exist at that time.
Or is eventhandling maybe the wrong way and I have to do with plugs? But when I do the dynamic binding I can only set the outbound plug of A and the inbound plug of B and not the other way.
LOOP AT wd_comp_controller->gt_component_usages ASSIGNING <ls_cmp_usage>.
lo_api_main->prepare_dynamic_navigation(
source_window_name = 'MAIN_WINDOW'
source_vusage_name = 'MAIN_VIEW_USAGE_0'
source_plug_name = 'TO_V1'
target_component_name = <ls_cmp_usage>-used_component
target_component_usage = <ls_cmp_usage>-component_usage_name
target_view_name = 'MAIN_WINDOW'
target_plug_name = 'DEFAULT'
target_embedding_position = <ls_cmp_usage>-embedding_position "'MAIN_VIEW/VC1'
).
ENDLOOP.
I read a lot of threads about dynamic components usage etc. but did't find a solution.
Many thanks in advance
Florian
.....I found the answer at the Demo WDR_TEST_CMP_USAGE_GROUP.
This is the code for adding a eventhandler to a component usage:
wa_cmp_usage-component_usage->add_event_handler(
listener = l_component_api
handler_name = 'HNDL_DATA_SELECTED'
controller_name = 'INTERFACECONTROLLER'
event_name = 'DATA_SELECTED' ).
And you have to define a eventhandler in the component controller without a specific event.
Maybe this answer could help someone else.
Regards
Florian
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
93 | |
11 | |
10 | |
9 | |
9 | |
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.