[TIMOB-26189] Windows: add buttonClickRequired method on Ti.UI.AlertDialog
GitHub Issue | n/a |
---|---|
Type | New Feature |
Priority | Medium |
Status | Closed |
Resolution | Won't Do |
Resolution Date | 2019-05-21T01:57:27.000+0000 |
Affected Version/s | Release 8.0.0 |
Fix Version/s | n/a |
Components | Windows |
Labels | n/a |
Reporter | Menno Juistdit |
Assignee | Kota Iguchi |
Created | 2018-07-09T23:36:58.000+0000 |
Updated | 2019-05-27T12:33:19.000+0000 |
Description
Adds the
buttonClickRequired
property to Ti.UI.AlertDialog
, which controls whether the dialog can be cancelled by clicking the system back button. Defaults to true
.
var win = Ti.UI.createWindow({layout: 'vertical'}),
button1 = Ti.UI.createButton({title: 'Cancelable'}),
button2 = Ti.UI.createButton({title: 'Non-cancelable'}),
dialog = Ti.UI.createAlertDialog({
message: 'Message',
ok: 'OK',
title: 'Title',
persistent: true
});
button1.addEventListener('click', function () {
dialog.buttonClickRequired = false;
dialog.show();
})
button2.addEventListener('click', function () {
dialog.buttonClickRequired = true;
dialog.show();
})
win.add([button1, button2]);
win.open();
Resolving this as "Won't Do" because Windows UWP MessageDialog component ([Windows::UI::Popups::MessageDialog](https://docs.microsoft.com/en-us/uwp/api/windows.ui.popups.messagedialog)) does not have a way to react to the back button. I have confirmed that Windows 10 Mobile phone treats the back button as a cancel button. The API document for UWP MessageDialog shows that there's [CancelCommandIndex](https://docs.microsoft.com/en-us/uwp/api/windows.ui.popups.messagedialog.cancelcommandindex#Windows_UI_Popups_MessageDialog_CancelCommandIndex) _unsigned_ int property and setting
-1
(despite CancelCommandIndex is _unsigned_ int !) to it could be used to ignore dismissal action but I have confirmed that it doesn't actually work.Closing ticket as it is marked as Won't do. If you feel this is a mistake feel free to reopen.