Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Alert Dialog not displayed in front of all windows

Hi,

I'm using Titanium Mobile SDK 1.3.0 and want to display an alert dialog in my Android app. I tried alert('test') and Titanium.UI.createAlertDialog. The problem is that the alert dialog appears not till I go back to the first window using the "back" Button.

I'm creating my windows like this:

var params = { title: 'test',
               modal: true };
var win = Titanium.UI.createWindow(params);
win.open();
...
win.add(...);
...
win.show();

I tried also with different params modal = false, and different zIndex but without success. I do not pass a url parameter.

This behavior also belongs to runtime errors. I see the runtime error dialog not till I go back to the first window.

Can anyone help me?

Thx + Greetz

— asked June 13th 2010 by Jicks Steen
0 Comments

4 Answers

  • This is how I do for now (alert function will not work):

    //do not set "a" in a function ! 
    //"a" must be global on the current window
    var a = Ti.UI.createAlertDialog();
    
    //then add "a" to "win"
    win.add(a);
    
    function tryAlert(obj){
       a.message = obj.message;
       a.title   = obj.title;
       a.show();
    }
    
    //test it:
    tryAlert({
       title: 'Test',
       message: 'My message to show'
    });
    

    But yes, this is a bug :)

    — answered July 12th 2010 by Patrice Ferlet
    permalink
    0 Comments
  • The alert dialog appears in front of all windows when I use the "url" parameter to create a new window, otherwise not. But I will not wan't to use the url parameter. Is there another solution?

    — answered June 14th 2010 by Jicks Steen
    permalink
    0 Comments
  • I have this issue in Titanium Mobile SDK 1.3.2 again now, even when I use the url parameter to open a new window. Has someone similar issues?

    — answered June 28th 2010 by Jicks Steen
    permalink
    0 Comments
  • This is how I do for now (alert function will not work):

    //do not set "a" in a function ! 
    //"a" must be global on the current window
    var a = Ti.UI.createAlertDialog();
    
    //then add "a" to "win"
    win.add(a);
    
    function tryAlert(obj){
       a.message = obj.message;
       a.title   = obj.title;
       a.show();
    }
    
    //test it:
    tryAlert({
       title: 'Test',
       message: 'My message to show'
    });
    

    But yes, this is a bug :)

    — answered July 12th 2010 by Patrice Ferlet
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.