on 06-21-2007 10:21 AM
Hi All,
I've written a pop-up with an input box. I'd like to prevent the pop-up from closing if the user hasn't entered anything in the input box.
I open the popup from one view via the code:
DATA: l_cmp_api TYPE REF TO if_wd_component,
l_window_manager TYPE REF TO if_wd_window_manager.
l_cmp_api = wd_comp_controller->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
IF wd_this->m_add_popup IS INITIAL.
wd_this->m_add_popup = l_window_manager->create_window(
window_name = 'ADDWINDOW'
button_kind = if_wd_window=>co_buttons_okcancel
message_type = if_wd_window=>co_msg_type_information ).
ENDIF.
lo_api = wd_this->wd_get_api( ).
wd_this->m_add_popup->subscribe_to_button_event(
button = if_wd_window=>co_button_ok
action_name = 'OK'
action_view = lo_api
is_default_button = abap_true ).
wd_this->m_add_popup->open( ).
I have tried putting validation in the WDDOBEFOREACTION method in the ADDVIEW.E.g.
l_current_controller ?= wd_this->wd_get_api( ).
CALL METHOD l_current_controller->get_message_manager
RECEIVING
message_manager = l_message_manager.
.
CALL METHOD l_message_manager->report_fatal_error_message
EXPORTING
message_text = 'Error - Please enter a quantity and date'.
exit.
If I write out a message via the message manager, it appears in the calling view, not the popup. Regardless of what I do, the pop-up always seems to close.
Can you help?
Cheers
Richard
Hello Richard,
you have to set:
window type ref to if_wd_window.
wd_this->window->set_close_in_any_case( abap_false ).
where you open the popup window.
Now the popup only closes when you call the close method of IF_WD_WINDOW. So you can make your validation and close the popup window only when the entries are ok.
Regards,
Rainer
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.