on 04-03-2007 7:22 PM
Hi,
I created an event in Component controller and fired the event in a method of component controller. I caught the event in the View controller and did some coding there(like firing plug). Usage of component controller is already present in the view.
But at runtime, my event is not getting fired in component controller. Can anyone tell me what might be the possible reason for such a behavior.
Regards,
Satheesh Raja.
hi , Yes you need to give parameters .You have pass normal ..like i have passed cur_level ,max_level ,cur_element ,node_name .Now these are my exporting parameters in my method call.
In implementation of method .I need to add in parameter table .
When you open any method you come across table Of parameter.
There I add it as
CUR_ELEMENT Importing 1 IF_WD_CONTEXT_ELEMENT
CUR_LEVEL Importing 0 I
MAX_LEVEL Importing 0 I
NODE_NAME Importing 0 STRING
and then my method was able to understand them .
I hope I have shown some direction to you .
Rewards points if really .
Cheers
Parry
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Parry,
I'll tell you what I've done. It will give you a better idea.
1.I created a event by name "MODIFY" in the component controller without any parameters.
2. I created a event handler "MODIFY_HANDLER" in the View controller.
3. I fire the event in a method of component controller.
Coding : wd_This->Fire_Modification_Evt( )
4. My event handler code in the View controller is not fired.
Coding : wd_This->Fire_Campaign_Out_Plg( ).
The above plug is not fired. Control never comes here when I debugged.
If you want me to pass the parameter, where I should do it. From the Event to the Event handler? I don't have any context element or node associated here. So I can't have the parameters that you have mentioned.
What I think is, WDEVENT is the importing parameter in the event handler and it is empty since I'm not associating any action with my event. I won't be able to fill this table manually since it is a hashed table. But I need values in WDEVENT to fire some plugs based on the values in it. If there is any way of binding my event with an action, WDEVENT will get filled up and my event handler code will work.
So can you please tell me how can i achieve this behavior.
Regards,
Satheesh Raja.
Hi All,
If I want to Raise the event in a component controller method without any action associated with it, then what should I do. My event handler is in the view.
When I debug, I found out that this event is not raised. Do I need the pass the parameters manually. If yes how?
Regards,
Satheesh Raja.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satheesh,
Kindly check your event handler code or call in the method.
e.g.
method onactionon_action.
wd_context->set_attribute( name = 'EVENT_ID' value = event_id ).
endmethod.
Or try debugging your code and you will get the exact error.
Cheers,
Darshna.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Satheesh ,
First of all , I will suggest you to add break point at that method and at Event.So you will be able to recognize weather or not control coming upto it .
Other than that this sample code where I have called <b>method</b> create_node from <b>Event</b> ONACTIONON_REC
<b>Action ON_REC</b>
<i>method ONACTIONON_REC .
create_node(
exporting
cur_level = 1
max_level = 1
cur_element = context_element
node_name = 'REC_ORG_UNIT' ).</i>
*******************************************************
<b>method CREATE_NODE</b> .
data:
lr_cur_node type ref to if_wd_context_node,
number type i.
create the new node by requesting it as a child node
lr_cur_node = cur_element->get_child_node( node_name ).
create its elements
if lr_cur_node->is_supplied( ) = abap_false.
do 5 times.
number = sy-index.
create_element(
exporting
cur_level = cur_level
max_level = max_level
cur_node = lr_cur_node
number = number
node_name = node_name ).
enddo.
endif.
endmethod.
endmethod.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi satheesh,
Please see if you are using the right attribute. All i mean to say is for try with wd_comp_controller instead of wd_context.
regards,
abhishek
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
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.