In converting WinUI to WebUI, I have to convert the popups. Seemingly no problem, right?
It is a bit annoying, but fairly easy to do. Here’s the conversion...
Old (WinUI) way:
pr_DoStuff
sp_Answer := DialogAsk(“Here’s a question”, “Yes”, “No”);
if sp_Answer = “Yes” then do this elseif sp_Answer = “No” then do that endif;
New (WebUI) way (with TWO procedures):
pr_DoStuff
winui::RequestPerformDialogWebUI(“”, “Here’s a question”, s_ButtonActions_YesNo, ‘pr_DoNextStuff’);
pr_DoNextStuff(sp_Answer) code is
if sp_Answer = “Yes” then do this elseif sp_Answer = “No” then do that endif;
HOWEVER, in the case of the Logoff Procedure, this doesn’t work. Specifically, I want to ask the user if they want to save the changed data, wait for them to respond, then save (or not) and close.
Old (WinUI) way:
p_SaveIt := DialogAsk(“Do you want to save before closing?”, “Yes”, “No”, “Cancel”);
if p_SaveIt = 1 then pr_SaveData;
return 1;
elseif p_SaveIt = 2 then
return 1;
else
return 0;
endif;
The new WebUI dialogs do NOT wait for the user to respond before running next snippets. And you are not allowed to run the Logoff Procedure to close the application from outside the traditional “X” to close.
How do we do this Logoff sequence in WebUI?