on 05-28-2009 2:24 PM
I have done a dynamic registation of a sub-component event in my WebDynpro component. The event is fired in the sub-component. But my event-handler method is not called.
Has anybody any hints, what i could have made wrong?
Code-Extracts:
In my sub-component:
METHOD onactionexit_dialog .
wd_comp_controller->Fire_exit_event_Evt( ).
ENDMETHOD.
In my main component
METHOD onactionmenu_click .
DATA:
lr_cmp_usage TYPE REF TO if_wd_component_usage
lr_api TYPE REF TO if_wd_view_controller,
....
lr_cmp_usage = wd_this->wd_cpuse_dialog( ).
lr_api = wd_this->wd_get_api( ).
lr_cmp_usage->create_component( component_name = ls_wdcomp-component_name ).
lr_cmp_usage->add_event_handler(
listener = lr_api
handler_name = 'END_DIALOG'
controller_name = 'INTERFACECONTROLLER'
event_name = 'EXIT_EVENT' ).
...
ENDMETHOD.
Furthermore the Method END_DIALOG is defined as event handler method in the corresponding view controller
Hi,
thank your very much Rahul for your support.
I tried several things today. When I embed the sub-component statically and register the event dynamically it works, like you said !
But my case is more complicated. I create the sub-component dynamically and register the event dynamically. This does not work, I can do what I want.
I put the two components in one program, one sub-componeent embedded statically the other dynamically. I debugged the object CL_WDR_COMPONENT_USAGE for both cases. The attribute EVENT_SUBSCRIPTIONS had the same content for both cases. But the event of statically embedded component reached my method, the one of the dynamically embedded component not.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Your suggestion, i have tried as well. I registered the event in the componentcontroller, but this didn't wiork either
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thank you Rahul for your answer,
your recommendations make sense, because point 1. I had forgotten first, but I have found out by myself, before I have posted this problem
1. Event is marked as interface event in sub component
2. You have declared the usage of interfacecontroller in the properties tab of view controller
So: Yes, I did these two things, but nevertheless it does not work.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
From code it seems that everything is fine but still please check few things.
1. Event is marked as interface event in sub component
2. You have declared the usage of interfacecontroller in the properties tab of view controller
If still, it doesn't workout then i would suggest you to write your eventhandler in componentcontroller and try to register there only.
Thanks,
Rahul
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
95 | |
11 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.