{ "id": "124285", "key": "TIMOB-16117", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "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-01-14T18:14:21.000+0000", "created": "2013-12-31T00:14:59.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "supportTeam" ], "versions": [], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2014-06-19T12:43:39.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": "h6.Issue description\r\nDeveloper is using self custom NavBar. They were hoping there would be a way to show the master view as a popover in portrait. \r\n\r\nh6.Steps to replicate\r\n1) Run simple test case at iPad simulator\r\n2) Have 'contentView' set with either masterNav or master window\r\n3) Click Popover twice. You can notice how the masterView gets bad positioned after couple of attempts. \r\n\r\nh6.Simple sample\r\n{code}\r\nvar nav;\r\n\r\nfunction openWindow(win) {\r\n\tnav.openWindow(win);\r\n}\r\n\r\nvar counter = 0;\r\n\r\nvar colors = ['red', 'green', 'blue', 'yellow', 'pink'];\r\n\r\nvar barcolors = ['teal', 'magenta', 'maroon', 'lightgray', 'purple'];\r\n\r\nfunction genWindow() {\r\n\tvar win = Ti.UI.createWindow({\r\n\t\tbackgroundColor : 'white',\r\n\t\twincount : counter\r\n\t});\r\n\r\n\twin.addEventListener('click', function() {\r\n\t\topenWindow(genWindow());\r\n\t});\r\n\r\n\twin.addEventListener('open', function(e) {\r\n\t\tvar count = e.source.wincount;\r\n\t\tif ( count = count % 5)\r\n\t\t\t;\r\n\t\tTi.API.info('WIN OPEN ' + e.source.wincount);\r\n\t\te.source.title = 'WINDOW ' + e.source.wincount;\r\n\t\te.source.backgroundColor = colors[count];\r\n\t\te.source.barColor = barcolors[count];\r\n\t\tcounter++;\r\n\t});\r\n\r\n\twin.addEventListener('close', function(e) {\r\n\t\tTi.API.info('WIN CLOSE ' + e.source.wincount);\r\n\t\tcounter--;\r\n\t});\r\n\twin.addEventListener('focus', function(e) {\r\n\t\tTi.API.info('WIN FOCUS ' + e.source.wincount);\r\n\t});\r\n\r\n\twin.addEventListener('blur', function(e) {\r\n\t\tTi.API.info('WIN BLUR ' + e.source.wincount);\r\n\t});\r\n\r\n\treturn win;\r\n}\r\n\r\nfunction genNav() {\r\n\tcounter = 0;\r\n\tnav = Ti.UI.iOS.createNavigationWindow({\r\n\t\twindow : genWindow(),\r\n\t\tbackgroundColor : 'transparent'\r\n\t});\r\n\r\n\tnav.addEventListener('open', function(e) {\r\n\t\tTi.API.info('NAV OPEN');\r\n\t});\r\n\r\n\tnav.addEventListener('focus', function(e) {\r\n\t\tTi.API.info('NAV FOCUS');\r\n\t});\r\n\r\n\tnav.addEventListener('blur', function(e) {\r\n\t\tTi.API.info('NAV BLUR');\r\n\t});\r\n}\r\n\r\nvar detail = Ti.UI.createWindow({\r\n\tbackgroundColor : 'white'\r\n});\r\nvar label1 = Ti.UI.createLabel({\r\n\ttext : 'Detail View'\r\n});\r\ndetail.add(label1);\r\n\r\nvar btn = Ti.UI.createButton({\r\n\ttop : 40,\r\n\ttitle : 'OPEN POPOVER'\r\n});\r\n\r\nbtn.addEventListener('click', function() {\r\n\tvar popover = getPopover();\r\n\tpopover.show({\r\n\t\tview : btn\r\n\t});\r\n});\r\n\r\ndetail.add(btn);\r\n\r\n//Navigation Window\r\nvar detailNav = Ti.UI.iOS.createNavigationWindow({\r\n\twindow : detail\r\n});\r\n\r\nvar master = Ti.UI.createWindow({\r\n\tbackgroundColor : 'gray'\r\n});\r\nvar label2 = Ti.UI.createLabel({\r\n\ttext : 'Master View'\r\n});\r\nmaster.add(label2);\r\n\r\nvar masterNav = Ti.UI.iOS.createNavigationWindow({\r\n\twindow : master\r\n});\r\n\r\nvar splitWin = Ti.UI.iPad.createSplitWindow({\r\n\tdetailView : detailNav,\r\n\tmasterView : masterNav,\r\n\tshowMasterInPortrait: false\r\n});\r\n\r\nsplitWin.addEventListener('visible', function(e) {\r\n\tif (e.view == 'detail') {\r\n\t\te.button.title = \"Master\";\r\n\t\tdetail.leftNavButton = e.button;\r\n\t} else if (e.view == 'master') {\r\n\t\tdetail.leftNavButton = null;\r\n\t}\r\n});\r\n\r\nsplitWin.open();\r\n\r\nfunction getPopover() {\r\n\tgenNav();\r\n\tvar popover = Ti.UI.iPad.createPopover({\r\n\t\twidth : 400,\r\n\t\theight : 400,\r\n\t\t\r\n\t\t//TC1: navigationWindow opens correctly\r\n\t\t//contentView : nav\r\n\t\t\t\t\r\n\t\t//TC2: Clicking \"OPEN POPOVER\" twice gets masterView bad positioned \r\n\t\tcontentView : masterNav\r\n\t\t\t\t\r\n\t\t//TC3: On attempt to set master window generates error below \r\n\t\t//contentView: master\r\n\t\t/*\r\n\t\t[ERROR] : message = \"The content view controller argument must be \r\n\t\tthe root of its associated view controller hierarchy.\";\r\n\t\t*/\r\n\t});\r\n\r\n\tpopover.addEventListener('hide', function(e) {\r\n\t\tnav = null;\r\n\t});\r\n\r\n\treturn popover;\r\n}\r\n{code}", "attachment": [], "flagged": false, "summary": "iOS: Unable to add MasterView to Popover", "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": "TiSDK 3.1.3.GA & 3.2.0.GA\r\niPad 7.0.3", "comment": { "comments": [ { "id": "288116", "author": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "body": "Closing as invalid, iOS doesn't allow to do this", "updateAuthor": { "name": "rtlechuga", "key": "rtlechuga", "displayName": "Radamantis Torres-Lechuga", "active": false, "timeZone": "Asia/Dubai" }, "created": "2014-01-14T18:14:21.000+0000", "updated": "2014-01-14T18:14:21.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }