on 05-24-2012 1:00 PM
Hi,
I have many actions & methods in my application. In those if I need to display any message I have to get the ref of message manager.
like below :-
* get message manager
data lo_api_controller type ref to if_wd_controller.
data lo_message_manager type ref to if_wd_message_manager.
lo_api_controller ?= wd_this->wd_get_api( ).
CALL METHOD lo_api_controller->get_message_manager
receiving
message_manager = lo_message_manager
Isi it possible to get the value of 'lo_message_manager' once in a method ( like wddoint) and kept it in a attribute.
then use the attribute every where.
Or If I can get the referrence by using any attribute in a view.
This will certainly minimize some lines of code.
Thanks & regards,
Monishankar Chatterjee
Yes definitley,
Just create an attribute of type IF_WD_MESSAGE_MANAGER in the attributes section of component controller and it wddoinit method write the code you wrote above and pass the message manager to the attribute created in Attributes Tab.
You can use this message manager now in all the views.
you can also create a global variable of TYPE REF TO if_wd_message_manager in your assistance class. Write the code you wrote above in wddoinit of component controller and pass the message manager to this global variable..
Now use this everywhere. In your assistance class, component controller as well as all views.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Yes moni,
you are absolutely right, go ahead.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
94 | |
11 | |
11 | |
10 | |
9 | |
8 | |
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.