FokkeZB / nl.fokkezb.loading

The widget provides a simple loading mask that can be easily styled and configured.
93 stars 18 forks source link

Loading + AlertDialog click event never triggered #42

Closed guiled closed 7 years ago

guiled commented 7 years ago

I have a problem with AlertDialog and loading widget. It may happen that the click event is never triggered by answering the dialog box...

var loader = Alloy.createWidget("nl.fokkezb.loading");

function doClick(e) {
    loader.show(null, function() {
    });

    var start = new Date().getTime();
    var a = Titanium.UI.createAlertDialog({
        title : 'b',
        message : 'a',
        buttonNames : ['Y', 'N'],
        cancel : 1
    });
    a.addEventListener('click', function() {
        Ti.API.info('click' + ((new Date().getTime() - start) / 1000));
        loader.hide();
    });
    Ti.API.info('index', 'alert show');
    a.show();
}

$.index.open();
guiled commented 7 years ago

Well... there is nothing to do with this widget...

The following code (no loading widget, only a createController() doesn't work good too...

function doClick(e) {
    Alloy.createController('test');

    var start = new Date().getTime();
    var a = Titanium.UI.createAlertDialog({
        title : 'b',
        message : 'a',
        buttonNames : ['Y', 'N'],
        cancel : 1
    });
    a.addEventListener('click', function() {
        $.label.text = 'dialog closed';
    });
    $.label.text = 'dialog open';
    a.show();
}

$.index.open();
guiled commented 7 years ago

And finally, this was due to the main-thread property that I put to true. With this property at false, it is ok