Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-26838] iOS: the openWindow() method of NavigationWindow does not work when called from base window open event

GitHub Issuen/a
TypeBug
PriorityNone
StatusClosed
ResolutionFixed
Resolution Date2019-04-25T13:36:01.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.1.0
ComponentsiOS
Labelsn/a
ReporterSatyam Sekhri
AssigneeVijay Singh
Created2019-02-20T00:10:27.000+0000
Updated2019-04-25T13:36:01.000+0000

Description

The openWindow() method of Ti.UI.NavigationWindow does not work when it is called from the open event of the base window. The openWindow method gets called successfully after the window layout is complete. The openWindow() method for TI.UI.iOS.NavigationWindow (which is deprecated in 8.0 in favour of Ti.UI.NavigationWindow) also does not work from window open event in 8.0. But it works fine in 7.5.0.GA SDK Steps to Reproduce: 1. Create a new mobile project. Add the code as shown below to the app.js 2. Launch the app on iOS device or simulator 3. Change the event from open to postlayout for win1.addEventListener 4. Again build and launch the app Actual Result: Step 2:The blue window does not open. It continues to show only red window Step4: The blue window is shown with navigation bar showing the option to navigate back to the red window Expected Result: On Step 2: The blue window should be shown with navigation bar showing the option to navigate back to the red window
Titanium.UI.setBackgroundColor('#000');
var win1 = Titanium.UI.createWindow({
    backgroundColor:"red",
    title:"Red Window"
});
 
var win2 = Titanium.UI.createWindow({
    backgroundColor:"blue",
    title:"Blue Window"
});
 
win2.addEventListener('open', function(e) {
    alert('win2');
});
win1.addEventListener('open', function(e) {
    alert('win1');
        nav.openWindow(win2,{animated:true});
});
  
var nav = Titanium.UI.createNavigationWindow({
   window: win1
});
nav.open();

Comments

  1. Vijay Singh 2019-02-21

    [~ssekhri] Given test case is not working on SDK 7.5.0.GA also. Can you once confirm please, if it's working on SDK 7.5.0.GA? Thanks!
  2. Satyam Sekhri 2019-02-21

    [~vijaysingh] Updated the test code a bit. For 7.5.0 you would obviously have to change Titanium.UI.createNavigationWindow to Titanium.UI.iOS.createNavigationWindow Also observed that it works on 7.5.0.GA when in Tiapp.xml the is set to false. However with "run-on-main-thread" set to false it does not work as expected on 8.0
  3. Vijay Singh 2019-02-22

    PR - https://github.com/appcelerator/titanium_mobile/pull/10723
  4. Samir Mohammed 2019-02-27

    FR Passed. Waiting on Jenkins build.
  5. Samir Mohammed 2019-04-25

    Closing ticket, fix verified in SDK Version 8.1.0.v20190425050927 Test and other information can be found at: https://github.com/appcelerator/titanium_mobile/pull/10723

JSON Source