[ALOY-466] Alloy TableViews with sections not reliably passing 'click' events
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2013-01-29T18:10:23.000+0000 |
Affected Version/s | n/a |
Fix Version/s | 2013 Sprint 03 |
Components | Runtime, XML |
Labels | alloy, events, tableview, tableviewsection |
Reporter | Joel Margolese |
Assignee | Tony Lukasavage |
Created | 2013-01-16T06:59:47.000+0000 |
Updated | 2014-01-29T00:07:11.000+0000 |
Description
If you create a TableView in an Alloy View, and then populate it with TableViewRow's which are created from Alloy view files, then click events are not passed to the parent. NOTE: if you create rows in dynamically in code or pre-defined in the TableView.xml file, then click events are passed.
ref: [Q&A | http://developer.appcelerator.com/question/146467/alloy-tableviews-with-sections-not-passing-click-events]
code to reproduce:
*index.xml*
<Alloy>
<Window>
<TableView id="jobsTable" onClick="rowWasClicked">
<TableViewSection id="activeSection" headerTitle="Current jobs"/>
<TableViewSection id="futureSection" headerTitle="Future jobs">
</TableViewSection>
</TableView>
</Window>
</Alloy>
*testRow.xml*
(.js and .ts files are blank)
<Alloy>
<TableViewRow id="row">
<View id="view" backgroundColor="red" width="20" height="20" />
</TableViewRow>
</Alloy>
*index.js*
function rowWasClicked(e) {
alert('you pressed me');
}
for (var i = 0; i < 5; i++) {
//$.activeSection.add(Ti.UI.createTableViewRow({title: 'row ' + (i+1)}));
var args = {};
var row = Alloy.createController('testRow', args).getView();
//row.bubbleParent = true;
$.activeSection.add(row);
}
$.index.open();
_notes_
(tableViewRow.xml is code I took from the TableViewRow online doc.)
If I remove the View (in the row), it works perfectly. If the View is in place, then only the 1st row responds to taps. (Using the iOS simulator.) The other rows are silent. It seems that other elements () etc don't seem to cause a problem.
And again, my table works perfectly IFF I don't use sections.
I also found the behavior (good or bad) doesn't always respond to my changes in the code unless I do a 'project clean'.
I also tried forcing $.view.bubbleParent = true but that didn't help anything.
Please let me know if you need more info or test cases.
Tony, Not sure if this is a duplicate of 1767 but I cross my fingers. Thanks for looking into it. Since this is rather blocking us, would you have any ETA?
The fixVersion gives an indication of ETA. This is slated for Alloy 1.0.1. Alloy 1.0.0 is tentatively scheduled for mid-February. The good thing about Alloy is that it is almost never technically "blocking". If you are unable to get the functionality you need in Alloy you can always fall back to constructing the table with sections in traditional Titanium code in your controller until this bug is fixed.
Can't reproduce. I ran the given test code against Titanium SDK 3.0.0.GA, both Alloy 1.0.0 and 0.3.6, and iOS sim 6.0 and both respond to clicks on all the rows in the section. Will reopen if a new failing test case is provided.
Hi, I have exactly the same problem as Joel. I'm on Titanium SDK 3.0.0.GA, Alloy 1.0.1 Anyone as a solution ? Thanks
Test case please as I have yet to reproduce this on my end. Once a test case has been posted I can revisit.
Here my case : index.js
index.xml
detail.xml
detail.js
Both Events are never fired. ///Update It seems that UI inside
index.js
Again, cannot reproduce. The label is generating the click event just fine for me. Are you sure there's not more code you aren't showing or something, because I just verified that everything works fine against your simpler test case.
Thanks for your time Tony. There's no more code. If it works for you then i will re-install Titanium, and launching a new Alloy project.