on 07-06-2007 8:40 AM
Hi,
If I've a inputfield, and I want that when the user put a wrong data, I could put a error message, for example <i>"The inputfield data is wrong, be patient and put the data good</i>", in message area.
How can I do it?
Thanks.
Hi Guillermo,
In your method, get the instance of the message manager as follows:
data: lr_view_controller type ref to if_wd_view_controller,
msg type ref to if_wd_message manager.
lr_view_controller = wd_this->wd_get_api( ).
msg = lr_view_controller->get_message_manager( ).
Now if you have message classes with your messages already defined, use the method
msg->report_t100_message(
msgid = <message class>
msgno = <message no>
msgty = <type - 'E'/'S'>
).
Check out the methods in the interface if_wd_message_manager for various types of messages that can be reported.
By default, the messages will appear on the top of the page. Instead, if you want them next to your input field, define a message area in your view and it will appear there.
Regards,
Nithya
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
You could use the following the code to show the message, if you are using a message class , you could get those messages also.
Data:lv_mesg type string,
lo_current_controller type ref to if_wd_controller,
lo_message_manager type ref to if_wd_message_manager.
lo_current_controller ?= wd_this->wd_get_api( ).
lo_message_manager = lo_current_controller->get_message_manager( ).
message i076(/MYMESSAGECLASS) into lv_mesg.
lo_message_manager->REPORT_SUCCESS( message_text = lv_mesg ).
Thanks
Anzy
hi,
you should build up an t100 message eg:
wd_this->m_messages->report_t100_message(exporting
msgid = id
msgno = no
msgty = msgty
p1 = parameter1
p2 = parameter2
...
).
or you can bind it to your field/context attribute
wd_this->m_messages->report_attribute_error_message(
message_text = text
element = context element where your inputfield value is on
attribute_name = name of the attribute in inputfield
).
m_messages is an attribute for the view type ref to if_wd_message_manager
which is an instance of message manager instantiated in the wddoinit.
grtz,
Koen
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 | |
10 | |
7 | |
6 | |
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.