[TIMOB-15428] IOS: iPad Popover can't be associated to a TableViewRow
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-03-17T20:19:07.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2014 Sprint 06, 2014 Sprint 06 SDK, Release 3.2.3, Release 3.3.0 |
Components | iOS |
Labels | ios6, ios7, ipad, module_popover, popover, qe-closed-3.2.3, qe-testadded, tableViewRow |
Reporter | Vincent |
Assignee | Vishal Duggal |
Created | 2013-10-03T18:50:48.000+0000 |
Updated | 2014-07-28T17:17:21.000+0000 |
Description
Trying to display a popover from a tableViewRow fails with the following message in the console
"Unable to display popover; view is not attached to the current window"
TEST CASE:
var win = Ti.UI.createWindow();
var section = Ti.UI.createTableViewSection();
for (var i=1; i < 5; i++) {
section.add(Ti.UI.createTableViewRow({
title:'Row '+i
}));
}
var table = Ti.UI.createTableView({
data:[section]
});
table.addEventListener('click', function(e){
Ti.API.info('You clicked row '+e.index);
Ti.API.info('source '+e.source);
Ti.API.info(JSON.stringify(e.row));
var popover = Ti.UI.iPad.createPopover({
width: 250,
height: 100,
title: 'a POpover',
});
//popover.show({view:e.source});
popover.show({view:e.row});
});
win.add(table);
var splitwin = Ti.UI.iPad.createSplitWindow({
detailView: Ti.UI.createWindow({backgroundColor:'red'}),
masterView: win,
orientationModes :[Ti.UI.LANDSCAPE_LEFT],
});
splitwin.open();
check in TiUIiPadPopOver.m -(void)updatePopoverNow in this case we are receiving a TiUITableViewRowProxy and the view property is nil for this kind of proxy. quick and dirty fix : search for the UItableViewCell contentView inside the TableViewRowProxy. So, to get the view in case of a TiUITableViewRowProxy I added in -(void)updatePopoverNow around line 289
I can't believe this problem exist for 4 years now .. http://developer.appcelerator.com/question/25961/possible-to-use-popoveroptiondialog-with-table-row-in-ipad
We currently have this scheduled to be fixed in 3.2.1.
Pulls pending master - https://github.com/appcelerator/titanium_mobile/pull/5468 3_2_X - https://github.com/appcelerator/titanium_mobile/pull/5469
Tested and verified the fix with: Appcelerator Studio, build: 3.2.3.201403171239 Titanium SDK, build: 3.2.3.v20140317142455 Node.JS Version: v0.10.13 NPM Version: 1.3.2 ├── acs@1.0.14 ├── alloy@1.3.1 ├── npm@1.3.2 ├── titanium@3.2.1 └── titanium-code-processor@1.1.0 Device:iPad iOS 7.0.3 Popover can be associated to a TableViewRow.