[ALOY-1505] Add ability to pass cancel attribute to Option element for OptionDialog
GitHub Issue | n/a |
---|---|
Type | Improvement |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-03-05T11:33:40.000+0000 |
Affected Version/s | n/a |
Fix Version/s | CLI Release 7.1.0, Alloy 1.14.0 |
Components | XML |
Labels | alloy, options, optionsdialog |
Reporter | Brenton House |
Assignee | Feon Sua Xin Miao |
Created | 2016-06-17T19:13:21.000+0000 |
Updated | 2019-06-24T23:48:11.000+0000 |
Description
{quote}As a developer,
I want to be able to mark an option as being the option to use for cancelling an OptionDialog in Alloy XML,
So that I can use OptionDialog in view without dependency on controller.
{quote}
Currently, I can do this:
<OptionDialog id="dialog" title="Delete File?" cancel="2" >
<Options>
<Option>Confirm</Option>
<Option platform="ios">Help</Option>
<Option>Cancel</Option>
</Options>
</OptionDialog>
However, if an option is not displayed due to conditional code, then the index number will no longer be valid.
Proposed new attribute:
<OptionDialog id="dialog" title="Delete File?">
<Options>
<Option>Confirm</Option>
<Option platform="ios">Help</Option>
<Option cancel="true">Cancel</Option>
</Options>
</OptionDialog>
Hello, Thanks for creating the ticket. Out engineering team will consider it. Please share more of your thoughts on how this help out. Moving this ticket. Regards, Sharif.
Any thoughts on this? Does it sound like something that could be added?
PR: https://github.com/appcelerator/alloy/pull/879
Verified the fix in CLI core 7.1.0-master.22. Cancel attribute can now be passed to the options element. Closing. Studio Ver: 5.1.2.201903111843 SDK Ver: 8.0.2.GA OS Ver: 10.14.5 Xcode Ver: Xcode 10.2.1 Appc NPM: 4.2.13 Appc CLI: 7.1.0-master.22 Daemon Ver: 1.1.3 Ti CLI Ver: 5.2.1 Alloy Ver: 1.14.0-1 Node Ver: 8.15.1 NPM Ver: 6.4.1 Java Ver: 10.0.2 Devices: ⇨ google Pixel (Android 9) IOS Simulator: ⇨ iPhone Xs (12.2)