Add a confirm exit message (like uiconfirm) for a WebApp

조회 수: 13 (최근 30일)
Shreedhar Savant Todkar
Shreedhar Savant Todkar 2021년 7월 13일
댓글: Shreedhar Savant Todkar 2021년 7월 16일
I am migrating one of my Standalone apps to a Matlab Webapp and indeed there are a lot of things to be removed, changed and modified as they do not work for a Web-application (listed here). I would like to however include one feature that will demand confirmation from the user when he tries to close the window.
Usually, for a standalone app, this is what I do (my CloseRequest function):
function figure1CloseRequest(app, event)
anss = uiconfirm(app.figure1, 'Do you wish to quit?', 'Confirm Exit', 'Options',{'Yes','No','Cancel'}, ...
'DefaultOption',3,'CancelOption',3, 'Icon', 'question');
switch anss
case 'Yes'
closereq();
otherwise
return;
end
end
However, this feature does not work in a Web-app. Is there a workaround to add something like this in a Web-app?

답변 (1개)

Rishik Ramena
Rishik Ramena 2021년 7월 16일
I see that 'uiconfirm' is supported for web apps. From the link you shared,
Here's a tutorial on how to use uiconfirm and deploy it as a web app from MATLAB.
  댓글 수: 1
Shreedhar Savant Todkar
Shreedhar Savant Todkar 2021년 7월 16일
Yes. uiconfirm works. But I would like to add it to confirm when we close the tab.
The code that I provided above, it works when I launch it on App-designer. But when it is launched on a browser, the uiconfirm to close the window does not work.

댓글을 달려면 로그인하십시오.

카테고리

Help CenterFile Exchange에서 MATLAB Web App Server에 대해 자세히 알아보기

태그

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by