{ "id": "61576", "key": "TIMOB-944", "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": [ { "id": "11224", "name": "Release 1.4.0", "archived": true, "released": true, "releaseDate": "2010-07-16" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2011-04-17T01:54:44.000+0000", "created": "2011-04-15T02:39:49.000+0000", "priority": { "name": "Trivial", "id": "5" }, "labels": [], "versions": [], "issuelinks": [], "assignee": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2011-04-17T01:54:44.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": "{html}

if you try to save a reference to the popover from the visible\nevent and then use it later, it crashes. here's the code:

\n

var masterWindow = Ti.UI.createWindow({

\n
\nbackgroundColor: '#fdf5e5',\nbarColor: '#ec4930'\n
\n

});

\n

var masterNavigationGroup =\nTi.UI.iPhone.createNavigationGroup({
\nwindow: masterWindow });

\n

var b = Ti.UI.createButton({

\n
\ntitle:'Search',\nheight:100,\nwidth:100\n
\n

}); b.addEventListener('click', function()
\n{

\n
\nTi.App.fireEvent('openMasterView');\n
\n

});

\n

var detailWindow = Ti.UI.createWindow({
\nbackgroundColor: '#f7f0e3', barColor: '#ec4930', rightNavButton: b\n});

\n

var detailNavigationGroup =\nTi.UI.iPhone.createNavigationGroup({
\nwindow: detailWindow });

\n

var splitWindow = Ti.UI.iPad.createSplitWindow({

\n
\ndetailView: detailNavigationGroup,\nmasterView: masterNavigationGroup\n
\n

});

\n

var masterPopover = null;
\nvar masterView = null;
\nsplitWindow.addEventListener('visible', function(e)
\n{

\n
\nmasterPopover = e.popover;\nmasterView = e.button\nif (e.view == 'detail') \n{\n    e.button.title = \"foo\";\n    detailWindow.leftNavButton = e.button; \n\n}\n\nelse if (e.view == 'master') \n{\n    detailWindow.leftNavButton = null;\n
\n

} });

\n

Ti.App.addEventListener(\"openMasterView\", function(d)
\n{

\n
\nTi.API.info('in openMasterView pop ' + masterPopover)\nif (masterPopover != null)\n{\n    masterPopover.show({view:masterView});  \n}\n
\n

});

\n

splitWindow.open();

{html}", "attachment": [], "flagged": false, "summary": "accessing detail default popover = crash", "creator": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "124404", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

The biggest issue here is that I have no idea what the user is\ntrying to accomplish. Why would you show a popover of a button? The\nwording seems to indicate that they want to show a popover of the\nmaster view, but why would you ever do that?

\n

There is an additional problem that the masterView variable\nappears to be incorrectly set at certain times as far as the\ncontext for the app event listener is concerned. Regardless, there\nare still problems with popovers.

\n

Here is some slightly modified code, which crashes in a\ndifferent (but vastly more appropriate) way:

\n
\nvar masterWindow = Ti.UI.createWindow({\n    backgroundColor: 'red',\n    barColor: '#ec4930'\n});\n\nvar masterPopover = null;\nvar masterView = null;\nvar b = Ti.UI.createButton({\n    title:'Search',\n    height:100,\n    width:100\n}); \nb.addEventListener('click', function()\n{\n    Ti.API.info('in openMasterView pop ' + masterPopover);\n    Ti.API.info('Master view: '+masterView);\n    if (masterPopover != null)\n    {\n        masterPopover.show({view:masterView, \n                            rect:{x:100,y:100,width:100,height:300}});  \n    }\n});\n\nvar detailWindow = Ti.UI.createWindow({\n    backgroundColor: 'blue', \n    barColor: '#ec4930', \n    rightNavButton: b \n});\n\nvar masterNavigationGroup = Ti.UI.iPhone.createNavigationGroup({\n    window: masterWindow\n});\nvar detailNavigationGroup = Ti.UI.iPhone.createNavigationGroup({\n    window:detailWindow\n});\n\nvar splitWindow = Ti.UI.iPad.createSplitWindow({\n    detailView: detailNavigationGroup,\n    masterView: masterNavigationGroup\n});\n\nsplitWindow.addEventListener('visible', function(e) {\n    Ti.API.log(e);\n    masterPopover = e.popover;\n    masterView = e.button;\n    if (e.view == 'detail') \n    {\n        e.button.title = \"foo\";\n        detailWindow.leftNavButton = e.button; \n    }\n    else if (e.view == 'master') \n    {\n        detailWindow.leftNavButton = null;\n    } \n    Ti.API.log('Master view:'+masterView);\n});\n\nsplitWindow.open();\n
\n

Looking into resolving this now.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:49.000+0000", "updated": "2011-04-15T02:39:49.000+0000" }, { "id": "124405", "author": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

They are trying to set the value of masterPopover in order to\nuse it later in the app. Seems valid to me.

{html}", "updateAuthor": { "name": "nwright", "key": "nwright", "displayName": "Nolan Wright", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:49.000+0000", "updated": "2011-04-15T02:39:49.000+0000" }, { "id": "124406", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Yeah, that comment was written before I took a look through some\nmore of the presentation code. There is still some kind of very\nstrange issue with setting masterView = e.button, however, because\nin the app event listener it wasn't the correct value (although it\nwas the right value in the context of the function which set\nit).

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:50.000+0000", "updated": "2011-04-15T02:39:50.000+0000" }, { "id": "124407", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [7fc6a66f81548c8535f270bed0106464fc0cfc65])\n[#944\nstate:open] Fixes to split window buttons. Necessary for upcoming\nchanges to how popovers display. \nhttp://github.com/appcelerator/titanium_mobile/commit/7fc6a66f81548...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:50.000+0000", "updated": "2011-04-15T02:39:50.000+0000" }, { "id": "124408", "author": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "body": "{html}

(from [c28c79c40727235b3481a0d042299b8a408fd22a])\nCloses #944: Removed access to the splitview's builtin\npopover. See the ticket for why. \nhttp://github.com/appcelerator/titanium_mobile/commit/c28c79c407272...

{html}", "updateAuthor": { "name": "jhaynie", "key": "jhaynie", "displayName": "Jeff Haynie", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:50.000+0000", "updated": "2011-04-15T02:39:50.000+0000" }, { "id": "124409", "author": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

This was a case of burning the village to save it. We shouldn't\nallow access to the popover that's managed by the split view,\nbecause certain magic happens with it - if it's messed with in any\nway, that magic might not happen (or could appear very odd).\nBesides, the popover doesn't have anything innate about it beyond\nbeing used for this special system: It doesn't automatically hold\nthe master view, for example.

\n

If it's absolutely necessary to display the master view in a\nnon-convential way via popover, you should make your own popover\nand manage it yourself, to display the master view when\nrequired.

{html}", "updateAuthor": { "name": "stephentramer", "key": "stephentramer", "displayName": "Stephen Tramer", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:50.000+0000", "updated": "2011-04-15T02:39:50.000+0000" }, { "id": "124410", "author": { "name": "tim.alosi", "key": "tim.alosi", "displayName": "Tim.Alosi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Regarding removing access to the Popover in a Splitview.

\n

There is one reason why one would need access to it ... to close\nit when an event is fired.

\n

If you look at the standard Mail app, when an email is selected\nfrom the splitview popover, the app automatically closes the\npopover and shows the detail window.

\n

Currently in the visible event, having the instance would allow\nthe app to close the popover. With out that access to the object,\nthere is no apparent way to close the default split view\nPopover.

\n

If there is, please post response.

\n

Thanks
\nTim

{html}", "updateAuthor": { "name": "tim.alosi", "key": "tim.alosi", "displayName": "Tim.Alosi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:51.000+0000", "updated": "2011-04-15T02:39:51.000+0000" }, { "id": "124411", "author": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Looking through the code, there is not currently a way exposed\nto close an open split view popover. I don't mind the ability to\nclose the split view popover, but I'd much rather it be\nfunctionality explicitly added to split view (IE,\nsplitView.closeMainViewPopover() ) rather than restore the previous\nhack. The previous hack was very error prone and would have caused\na great many problems going forward.

{html}", "updateAuthor": { "name": "blainhamon", "key": "blainhamon", "displayName": "Blain Hamon", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:51.000+0000", "updated": "2011-04-15T02:39:51.000+0000" }, { "id": "124412", "author": { "name": "tim.alosi", "key": "tim.alosi", "displayName": "Tim.Alosi", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

So, can we get such a function into the road map for 1.5 or a\nlater release?

{html}", "updateAuthor": { "name": "tim.alosi", "key": "tim.alosi", "displayName": "Tim.Alosi", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:51.000+0000", "updated": "2011-04-15T02:39:51.000+0000" }, { "id": "124413", "author": { "name": "craigmarvelley", "key": "craigmarvelley", "displayName": "Craig Marvelley", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Hi,

\n

Was a solution ever put in place for this functionality? It's\ncrucial that we are able to dismiss the popover programmatically,\nnot just from a UX point of view but also because it can cause\ncrashes. For example, if one attempts to close a split window while\nthe popover is still visible, the following crash occurs:

\n
\n2011-03-06 13:18:52.817 S4CiPad[91506:207] *** Terminating app due to uncaught exception 'NSGenericException', reason: '-[UIPopoverController dealloc] reached while popover is still visible.'\n
\n

Thanks.

{html}", "updateAuthor": { "name": "craigmarvelley", "key": "craigmarvelley", "displayName": "Craig Marvelley", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T02:39:51.000+0000", "updated": "2011-04-15T02:39:51.000+0000" } ], "maxResults": 10, "total": 10, "startAt": 0 } } }