{ "id": "79690", "key": "TIMOB-5124", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2014-02-05T23:30:54.000+0000", "created": "2011-08-26T13:41:36.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [ "api", "look1" ], "versions": [ { "id": "11570", "description": "", "name": "Release 1.7.2", "archived": true, "released": true, "releaseDate": "2011-07-21" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-21T21:07:34.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10206", "name": "iOS", "description": "iOS Platform" } ], "description": "h5.Problem\r\nWhen there's a navigation group that has 2 or more windows, when popover.show() or has been created a new popover within the navigationGroup is the Window1 shown, not window 2 or 3 depending which was showing in the popover before popover.hide() was called.\r\n\r\nThis is possible on native iOS. If you navigate to the \"iPad -> App Store -> Top Charts -> All Categories (left nav button)\" you can see the popover with its state being remembered every time. \r\n\r\nh5.Expected behaviour\r\nLatest window shown in navgroup\r\n\r\nh5.Current behaviour\r\nGoes back to the first-level of the navgroup\r\n\r\nh5.Tested on\r\nSimulator iOS 4.3\r\niPad 1 device\r\n\r\nh5.Repro sequence\r\n{code:title=app.js}\r\n\r\nvar window = Titanium.UI.createWindow({\r\n});\r\n\r\nvar popOver_button = Titanium.UI.createButton({\r\n\ttitle : \"PopOver Button\",\r\n\twidth : 150,\r\n\theight : 35\r\n})\r\n\r\nwindow.add(popOver_button);\r\n\r\n// add navigationGroup to popOver\r\nvar navigationGroup = createPopOverNavigationGroup(window.popover);\r\n\r\npopOver_button.addEventListener('click', function() {\r\n\r\n\t// appreciate code review by @pecdev where he indicated in earlier posting\r\n\t// i was creating the pop over every time, i have addressed the issue\r\n\tif(window.popover == null) {\r\n\t\tTi.API.debug(\"Creating window.popover\");\r\n\t\twindow.popover = Ti.UI.iPad.createPopover({\r\n\t\t\twidth : 400,\r\n\t\t\theight : 300,\r\n\t\t\tarrowDirection : Ti.UI.iPad.POPOVER_ARROW_DIRECTION_ANY,\r\n\t\t\tnavBarHidden : true,\r\n\t\t});\r\n\r\n\t\twindow.popover.add(navigationGroup);\r\n\t} else {\r\n\t\tTi.API.debug(\"using existing window.popover\");\r\n\t}\r\n\r\n\twindow.popover.show({\r\n\t\tview : popOver_button,\r\n\t\tanimated : true\r\n\t});\r\n\r\n});\r\nwindow.open();\r\n\r\n//create the popover window when the user clicks the button\r\n\r\nfunction createPopOverNavigationGroup(popover) {\r\n\r\n\t// add close button to close the popover\r\n\tvar close_button = Ti.UI.createButton({\r\n\t\ttitle : 'Close'\r\n\t});\r\n\tclose_button.addEventListener('click', function() {\r\n\t\twindow.popover.hide({\r\n\t\t\tanimated : true\r\n\t\t});\r\n\t\tTi.API.info('CloseButton called');\r\n\t});\r\n\tvar win1 = Titanium.UI.createWindow({\r\n\t\ttitle : \"NavGroup In Popover\",\r\n\t\tbackgroundColor : '#fff',\r\n\t\tbarColor : 'black'\r\n\t});\r\n\twin1.rightNavButton = close_button;\r\n\r\n\t// create a table with some rows to click, a pretty common use of navGroup\r\n\tvar tableView = Titanium.UI.createTableView({\r\n\t\twidth : '100%',\r\n\t\theight : '100%',\r\n\t\trowHeight : 'auto',\r\n\t\tbarColor : 'black',\r\n\t\tdata : [{\r\n\t\t\ttitle : \"Row1\"\r\n\t\t}, {\r\n\t\t\ttitle : \"Row2\"\r\n\t\t}]\r\n\t});\r\n\twin1.add(tableView);\r\n\r\n\t// create the navigationGroup\r\n\tvar navGroup = Ti.UI.iPhone.createNavigationGroup({\r\n\t\twindow : win1\r\n\t});\r\n\r\n\t// event listener for the clicks\r\n\ttableView.addEventListener('click', function(e) {\r\n\r\n\t\t// create window when row is clicked and show title of row\r\n\t\tvar detailWindow = Ti.UI.createWindow({\r\n\t\t\tbarColor : 'black',\r\n\t\t\ttitle : \"Detail Window\",\r\n\t\t\tbackButtonTitle : \"Back\",\r\n\t\t});\r\n\r\n\t\t// label to show the title\r\n\t\tvar label = Titanium.UI.createLabel({\r\n\t\t\ttext : \"Clicked \" + e.row.title,\r\n\t\t\twidth : '100%',\r\n\t\t\tcolor : 'white',\r\n\t\t\theight : 35,\r\n\t\t\ttextAlign : 'center'\r\n\t\t})\r\n\t\tdetailWindow.add(label);\r\n\r\n\t\t// open the window using the navGroup\r\n\t\tnavGroup.open(detailWindow);\r\n\r\n\t\t///////////////////////////////////////////////////////////////////////////////\r\n\t\tvar overImage = Titanium.UI.createView({\r\n\t\t\twidth : 320,\r\n\t\t\theight : 480,\r\n\t\t\tbackgroundImage : 'KS_nav_ui.png.png',\r\n\t\t\ttop : 0,\r\n\t\t\tleft : 0\r\n\t\t});\r\n\r\n\t\tvar overlay = Titanium.UI.createView({\r\n\t\t\twidth : 320,\r\n\t\t\theight : 480,\r\n\t\t\ttop : 0,\r\n\t\t\tleft : 0\r\n\t\t});\r\n\t\toverlay.add(overImage);\r\n\r\n\t\tTitanium.Media.showCamera({\r\n\r\n\t\t\tsuccess : function(event) {\r\n\t\t\t\tvar cameraView = Ti.UI.createImageView({\r\n\t\t\t\t\twidth : 320,\r\n\t\t\t\t\theight : 480,\r\n\t\t\t\t\ttop : 0,\r\n\t\t\t\t\tleft : 0,\r\n\t\t\t\t\timage : event.media\r\n\t\t\t\t});\r\n\t\t\t\tcameraView.add(overImage);\r\n\t\t\t\tvar imageNew = cameraView.toImage(function(e) {\r\n\t\t\t\t\t// Save Image\r\n\t\t\t\t\tvar filename1 = Titanium.Filesystem.applicationDataDirectory + \"/NAMEOFTHEPICTURE.png\";\r\n\t\t\t\t\tf = Titanium.Filesystem.getFile(filename1);\r\n\t\t\t\t\tf.write(e.blob);\r\n\t\t\t\t\tTitanium.Media.saveToPhotoGallery(f);\r\n\t\t\t\t\tTitanium.Media.hideCamera();\r\n\t\t\t\t\t//alert('my media' + event.media.width);\r\n\t\t\t\t});\r\n\t\t\t\tvar thumbCameraView = Ti.UI.createImageView({\r\n\t\t\t\t\twidth : 150,\r\n\t\t\t\t\theight : 225,\r\n\t\t\t\t\ttop : 0,\r\n\t\t\t\t\tleft : 0,\r\n\t\t\t\t\timage : event.media\r\n\t\t\t\t});\r\n\t\t\t\tthumbCameraView.add(thumbOverImage);\r\n\t\t\t\twin.add(thumbCameraView);\r\n\t\t\t},\r\n\t\t\tcancel : function() {\r\n\t\t\t},\r\n\t\t\terror : function(error) {\r\n\t\t\t\tvar a = Titanium.UI.createAlertDialog({\r\n\t\t\t\t\ttitle : 'Camera'\r\n\t\t\t\t});\r\n\t\t\t\tif(error.code == Titanium.Media.NO_CAMERA) {\r\n\t\t\t\t\ta.setMessage('Camera Error');\r\n\t\t\t\t} else {\r\n\t\t\t\t\ta.setMessage('Errore: ' + error.code);\r\n\t\t\t\t}\r\n\t\t\t\ta.show();\r\n\t\t\t},\r\n\t\t\toverlay : overImage,\r\n\t\t\tshowControls : true,\r\n\t\t\tmediaTypes : Ti.Media.MEDIA_TYPE_PHOTO,\r\n\t\t\tsaveToPhotoGallery : false,\r\n\t\t\tallowEditing : true,\r\n\t\t\tallowImageEditing : true\r\n\t\t\t//autohide:false // tell the system not to auto-hide and we'll do it our self\r\n\t\t});\r\n\r\n\t});\r\n\treturn navGroup;\r\n}\r\n{code}\r\n\r\nh5.Associated HD ticket\r\n#APP-924145", "attachment": [], "flagged": false, "summary": "iPad: Popover to not forget its state after hide()", "creator": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "egomez", "key": "egomez", "displayName": "Eduardo Gomez", "active": false, "timeZone": "America/Los_Angeles" }, "environment": " Product: Mobile\r\n Titanium SDK: Mobile 1.7.2\r\n Platform OS: iOS\r\n Platform OS Version: 4.3+", "comment": { "comments": [ { "id": "164184", "author": { "name": "mark.henderson@snagr.co.uk", "key": "mark.henderson@snagr.co.uk", "displayName": "Mark Henderson", "active": true, "timeZone": "Europe/London" }, "body": "I did notice that an orientation change appears to hide and re-show the policed and the navigationGroup will be displaying window2 or 3 not back to the first window.", "updateAuthor": { "name": "mark.henderson@snagr.co.uk", "key": "mark.henderson@snagr.co.uk", "displayName": "Mark Henderson", "active": true, "timeZone": "Europe/London" }, "created": "2011-08-26T13:51:19.000+0000", "updated": "2011-08-26T13:51:19.000+0000" }, { "id": "227757", "author": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The default behavior for popover is to be destroyed once the popover is hidden and recreated again when shown. This is the intended behavior of popOvers. For example take the native iOS photos app. Touch on the slideshow button to reveal the popover, navigate into the transitions, click outside the popover to hide . Click on Slideshow again, it would recreate the popover and clearing any previous stat you where in. \n\nWhile hiding and re-showing popover during orientation change is a different scenario, we do that intentionally so that the bounds of the popover a properly changed and layout properly after orientation change animation is over. \n\nMarking ticket as invalid. ", "updateAuthor": { "name": "srahim", "key": "srahim", "displayName": "Sabil Rahim", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-11-16T22:34:18.000+0000", "updated": "2012-11-16T22:34:18.000+0000" }, { "id": "291552", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Re-resolving.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2014-02-05T23:30:54.000+0000", "updated": "2014-02-05T23:30:54.000+0000" }, { "id": "414412", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as invalid.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-21T21:07:34.000+0000", "updated": "2017-03-21T21:07:34.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }