value check in WDDOBEFOREACTION - time Problem
in my view the user changes data in an input field.
The data has not saved jet. So i try to implement a check in the method WDDOBEFOREACTION in my view.
This check is creating an popup field where the user gets an infomation that the data has changed and ask him, if he want to save the data.
Yes, No, Cancel.
If the user klicks on Yes da Data schuld be saved.
My Problem here is the timing.
The user enters data (not saving it), than he whants do see an other view of my application, but before that klick the method WDDOBEFOREACTION starts.
In the Testing the Popup was shown, but in background the view has changed. So the logig in my WDDOBEFOREACTION did not stop the Prozess as it is shown in this grafik.
And because of that my inputfield data (changed data) was lost.
What am i dooing wrong? Can i put something like a Stop statement in my popup ?
Is there a Solution for my timing Problem?
Navigation can be interrupted at this point if an error occurred during the event handling in the previous step. The method CANCEL_NAVIGATIION can be called in the interface IF_WD_COMPONENT to terminate navigation. This method call prevents navigation for the entire application within a request/response cycle. Navigation requests are deleted during the subsequent run of the phase model and must be reinitialized.
so i did this...
method POPUP_SAVE_WARNUNG .
DATA: l_cmp_api TYPE REF TO if_wd_component,
l_window_manager TYPE REF TO if_wd_window_manager,
l_popup TYPE REF TO if_wd_window,
l_text TYPE string_table,
l_api TYPE REF TO if_wd_view_controller.
l_cmp_api = wd_this->wd_get_api( ).
l_window_manager = l_cmp_api->get_window_manager( ).
INSERT `Ihre Daten wurden verändert, nicht gespeicherte Daten gehen verloren ` INTO TABLE l_text. "#EC *
INSERT `Daten jetzt sichern ?` INTO TABLE l_text. "#EC *
l_popup = l_window_manager->create_popup_to_confirm(
text = l_text
button_kind = if_wd_window=>co_buttons_yesnocancel
message_type = if_wd_window=>co_msg_type_question
window_title = 'Sicherheitsabfrage'
window_position = if_wd_window=>co_center ). "#EC *
and it worked nicly
just 1 little thing...is there a way to start the naviagtion after the user pushes the YES button of my pupup?