[TIMOB-26838] iOS: the openWindow() method of NavigationWindow does not work when called from base window open event
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | None |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2019-04-25T13:36:01.000+0000 |
Affected Version/s | Release 8.0.0 |
Fix Version/s | Release 8.1.0 |
Components | iOS |
Labels | n/a |
Reporter | Satyam Sekhri |
Assignee | Vijay Singh |
Created | 2019-02-20T00:10:27.000+0000 |
Updated | 2019-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();
[~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!
[~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
PR - https://github.com/appcelerator/titanium_mobile/pull/10723
FR Passed. Waiting on Jenkins build.
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