[TIMOB-12616] iOS: TableView Click Events dont get added under certain circumstances
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Resolved |
Resolution | Cannot Reproduce |
Resolution Date | 2013-11-21T19:33:05.000+0000 |
Affected Version/s | Release 3.0.0 |
Fix Version/s | Release 3.1.0, 2013 Sprint 06 API, 2013 Sprint 06 |
Components | iOS |
Labels | api, module_tableview, parity, qe-testadded, release-note, triage |
Reporter | Rick Blalock |
Assignee | Ingo Muschenetz |
Created | 2013-02-07T15:28:01.000+0000 |
Updated | 2017-12-18T14:58:31.000+0000 |
Description
If a section is added to a table using table.appendSection, table.sections = [mySection]; any events on a tableview dont work. Below are some samples. What works is contrary to the 3.0 documentation where it says now in 3.x+ the section methods and properties should be used over data:
var win = Ti.UI.createWindow({
backgroundColor:"#eee"
});
win.open();
var table = Ti.UI.createTableView();
var section = Ti.UI.createTableViewSection();
section.headerView = (function() {
var view = Ti.UI.createView();
var label = Ti.UI.createLabel({ text: "Some Section" });
view.add(label);
return view;
})();
var row = Ti.UI.createTableViewRow({
title: "Row"
});
section.add(row);
// THIS WILL KILL THE EVENT LISTENER
//table.sections = [section];
// THIS WILL KILL THE EVENT LISTENER
//table.appendSection(section);
// THIS WORKS
//table.setData([section]);
table.addEventListener("click", function(event) {
alert("TableView Clicked");
Ti.API.debug(event.row);
});
win.add(table);
Appears to affect other section manipulation methods, such as insertSectionAfter.
@Rick Is the issue just about the row, or also the section header? Those are two different issues that have similar symptoms, and just wanted to know if you wanted both fixed, or just rows.
Those playing along, https://github.com/BlainHamon/titanium_mobile/compare/master...timob-12616
@Blain - The issue the ticket is reporting is if you use the section methods mentioned above, click events dont work. The other part is probably a documentation issue that could spin off as another ticket I assume.
@Rick Yeah, in retrospect, the tableview click events correspond to the user tapping a row; no such events are generated natively for tapping the header. Creating pull request now.
https://github.com/appcelerator/titanium_mobile/pull/3971
PR Merged
Tested with: SDK:3.1.0.v20130319222852 Studio: 3.1.0.201303091040 Device: iPad2(v 5.1) Works as expected.
Opening to correct labels.
Reopening just to update the labels.
Updated label. Closing as fixed, Verified with environment: OSX: 10.8.4 Xcode:4.5 Appcelerator Studio, build: 3.1.2.201307191853 SDK:3.1.2.v20130718094558 Device: Google nexus 4.0.4, Iphone OS:5.1 acs:1.0.3 alloy:1.1.3 titanium: 3.1.1 titanium-code-processor:1.0.1
I am seeing this same issue in 3.1.3.GA; Is there possibly a regression? If so I will create a new ticket but it'd make more sense to keep it here.
Cannot reproduce issue on 3.2.x master (Build: [7e04bf3ec2094770295ec0bf5c833741b0178f04](https://github.com/appcelerator/titanium_mobile/tree/7029e7a83674a8ca4ae66799cc5c377092ab774a)) and 3.1.X (build : ff583e9747925932ca589e277f49799d7c0348bc|https://github.com/appcelerator/titanium_mobile/commit/ff583e9747925932ca589e277f49799d7c0348bc]) Tested on Xcode 5.0.1 on sim 6.1 and 7.0.3
Problem still persists, tested on SDK: 3.5.0, Ipad MIni 1 Model A1455.
So... I appear to be having this issue now on 6.3.0 and 6.0.4. Click events don't fire with
Click events do fire when I only provide an array of rows for the last section