Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-10731] BlackBerry: AlertDialog.buttonNames setting bug

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionFixed
Resolution Date2013-11-14T18:00:39.000+0000
Affected Version/sn/a
Fix Version/s2013 Sprint 16, 2013 Sprint 16 API, Release 3.2.0
ComponentsBlackBerry
Labelsn/a
ReporterHayk Zakaryan
AssigneePedro Enrique
Created2012-08-31T08:02:53.000+0000
Updated2013-11-14T19:24:12.000+0000

Description

when trying to set alertDialog.buttonNames = null; after it has already been set to some custom values (for example alertDialog.buttonNames = ['One', 'Two','Three']) - alertDialog still has the custom buttons on it. Expected result should be: have the default buttons on alert dialog

Comments

  1. Pedro Enrique 2013-08-02

    PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/144
  2. Priya Agarwal 2013-11-13

    Hi, Had some query regarding the bug hence could not close it. Firstly like to mention according to appcelerator doc alertDialog's buttonNames property is a property which needs to be defined at time of creation only. So we cannot change the value at run time. Hence I have checked the alertDialog with two different mentioned scenarios above: Scenario 1(with Custom Values):
        var dialog = Ti.UI.createAlertDialog({
           cancel: 1,
           buttonNames: [confirm,help,cancel],
           message: 'Would you like to delete the file?',
           title: 'Delete'
         });
       
    Result:Getting the expected alertDialog with three buttons. Scenario 2(with null value)
        var dialog = Ti.UI.createAlertDialog({
           cancel: 1,
           buttonNames: null,
           message: 'Would you like to delete the file?',
           title: 'Delete'
         });
       
    Result: Getting the Standard alertDialog with one button(OK). So this is only which is expected from the issue raised. Or some other behavior is expected. Please confirm.
  3. Pedro Enrique 2013-11-13

    To clarify, this is expected behavior. Just like in iOS, at least one button will be displayed in BB10. If null is passed in, the default "ok" button will show.
  4. Samuel Dowse 2013-11-14

    Verified fixed on: Mac OSX 10.9 Mavericks Titanium Studio, build: 3.2.0.201311140700 Titanium SDK, build: 3.2.0.v20131113183932 CLI: 3.2.0 Alloy: 1.3.0 BlackBerry Simulator: 10.2.0.1791 Alert dialog shows correct buttons. OK button shows when null is passed in. Closing.

JSON Source