Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-16947] Blackberry : Titanium.UI.AlertDialog.hide() prevents reuse of dialog

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionWon't Fix
Resolution Date2014-05-13T06:34:41.000+0000
Affected Version/sRelease 3.2.2, Release 3.2.3
Fix Version/sn/a
ComponentsBlackBerry
Labelsapi, defect, look1
ReporterThorsten Meyer
AssigneeMauro Parra-Miranda
Created2014-04-30T20:54:53.000+0000
Updated2017-03-16T20:21:58.000+0000

Description

Problem Description

If a AlertDialog is hidden by .hide(), the Dialog can not be shown again using .show(). Happens on Blackberry Simulator an on device.

Steps to reproduce

1. Create a new mobile project with bb support 2. Add this to app.js:
var win = Ti.UI.createWindow({backgroundColor:'white',});
win.open();

var a = Ti.UI.createAlertDialog(

{ message: 'Message a', buttonNames: ['OK'] }
);
a.show();
a.hide();
a.show();
3. Run this in the emulator.

Expected results

The app showing the alert dialog.

Actual results

The app doesn't show anything after using the .hide function.

Extra info

If you try to show other dialogs, and use hide in the first one, that hide will block all the others dialogs, like in this code:
var win = Ti.UI.createWindow({backgroundColor:'white',});
win.open();

var other = Ti.UI.createAlertDialog(

{ message: 'Message other', buttonNames: ['OK'] }
);
var a = Ti.UI.createAlertDialog(

{ message: 'Message a', buttonNames: ['OK'] }
);
a.show();
a.hide();
other.show();
a.show();
even if other is never "hide", it won't show. We ran this code and the one in the steps to reproduce in iOS and Android, and ran without issues.

Comments

  1. Thorsten Meyer 2014-05-05

    To make this more worse: if i hide one Titanium.UI.AlertDialog with .hide(), other dialogs after this will not show up too! Example: var other = Ti.UI.createAlertDialog({ message: 'Message', buttonNames: ['OK'] }); var a = Ti.UI.createAlertDialog({ message: 'Message', buttonNames: [] }); a.show(); a.hide(); other.show(); 'other' will not pop up.
  2. Mauro Parra-Miranda 2014-05-12

    Note to the reporter: The priority will be set by the Leader of the project. Thanks for reporting this issue! We will look into it as soon as possible.
  3. Pedro Enrique 2014-05-13

    AlertDialogs in BlackBerry are not to be reused. They get internally deleted after hidden. If we were to keep them alive, we would run into memory issues and crashers. Do not reuse an AlertDialog. Thanks for reporting.
  4. Mauro Parra-Miranda 2014-05-13

    Reopening and creating two bugs: 1. One for docs (this should be documented) 2. This is still failing if at least one of your dialogs are in "hide" state (which should not affect the behavior of other dialog, since they are independent).
  5. Mauro Parra-Miranda 2014-05-13

    Since this one was marked as won't fix by the platform team, we added two bugs (clone of this one): - One for documenting the behavior - One to fix the effect of the hide function across other dialogs in the window.
  6. Pedro Enrique 2014-05-15

    Fixed in this PR: https://github.com/appcelerator/titanium_mobile_blackberry/pull/224
  7. Lee Morris 2017-03-16

    Closing ticket as BlackBerry is no longer supported by us.

JSON Source