Titanium JIRA Archive
Alloy (ALOY)

[ALOY-1505] Add ability to pass cancel attribute to Option element for OptionDialog

GitHub Issuen/a
TypeImprovement
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2019-03-05T11:33:40.000+0000
Affected Version/sn/a
Fix Version/sCLI Release 7.1.0, Alloy 1.14.0
ComponentsXML
Labelsalloy, options, optionsdialog
ReporterBrenton House
AssigneeFeon Sua Xin Miao
Created2016-06-17T19:13:21.000+0000
Updated2019-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>

Comments

  1. Sharif AbuDarda 2016-06-17

    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.
  2. Brenton House 2016-11-30

    Any thoughts on this? Does it sound like something that could be added?
  3. Feon Sua Xin Miao 2018-02-16

    PR: https://github.com/appcelerator/alloy/pull/879
  4. Lokesh Choudhary 2019-06-24

    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)

JSON Source