*This is a regression from 5.5.1.GA*
When a tableview is filtered based of a search performed via a searchbar eventListeners are not maintained
var _window = Ti.UI.createWindow();
var data = [{
title: 'First Row',
hasDetail: true
}, {
title: 'Second Row',
hasDetail: true
}, {
title: 'Third Row',
hasDetail: true
}, {
title: 'Forth Row',
hasDetail: true
}, {
title: 'Fifth Row',
hasDetail: true
}];
var search = Ti.UI.createSearchBar({
top:0,
returnKeyType: Ti.UI.RETURNKEY_DONE
});
var tableView = Ti.UI.createTableView({
top:50,
data: data,
search: search
});
tableView.addEventListener('click', function(e) {
alert('Click Event. index: ' + e.index + ', Title: ' + e.row.title);
});
_window.add(tableView);
_window.open();
https://github.com/appcelerator/titanium_mobile_windows/pull/925
Cherry-pick for 6_0_X: https://github.com/appcelerator/titanium_mobile_windows/pull/932
Tested with the following environment: NPM Version: 2.15.9 Node Version: 4.6.0 Windows OS: 10 Pro, Version 1607 Build 14393.693 Appc CLI: 6.1.0 Appc CLI NPM: 4.2.8 Titanium SDK version: 6.1.0.v20170124122351 and 6.0.2.v20170123140026 Windows Phone Devices 8.1 and 10 Windows Emulators 8.1 and 10 Using the demo code in the description, the latest SDK's 6.1.0 and 6.0.2 continue to show the originally reported bug. After installing the app, I searched for "third", and hit return. The row with "third" was then the only row visible. When clicking on the row, the row turned and stayed gray as long as the mouse button was held down. When releasing the mouse button, no alert popup was seen (a popup was expected to be seen). I closed and relaunched the app, and clicked on a row without searching first, and an alert popup was seen.
I guess that's because Jenkins has failed to build the nightly SDK. Let me check and let you know when it's ready.
I tested this today with newer builds (all other environment settings in my previous comment still apply): Titanium SDK version: 6.1.0.v20170125103400 Titanium SDK version: 6.0.2.v20170124145857 Windows Phone Devices 8.1 and 10 Windows Emulators 8.1 and 10 [~kota] The newest SDK 6.1.0 has your fix, as now I can see the alert after filtering by search. The SDK 6.0.2 which I installed today doesn't have the fix yet, so I don't know if you're still getting build failures. Can you let me know when it's ready?
[~amukherjee] Yeah I was asking [~cwilliams] about it yesterday. I will let you know then. (y)
[~kota] Thanks. Just to give an update, the build from this morning still doesn't have the fix: 6.0.2.v20170126032914. I tried it on device and emulator, for both Win Phone 10 and 8.1.
[~kota] There is an issue with the latest build from master. Same configuration as above, but with SDK 6.1.0.v20170202120400, when the app launched, I saw this error on the device (Windows 10): _Application error add: No installed components were detected. Element is already the child of another element_. I tried with a default app and did not see this error, so it is specific to this ticket.
[~amukherjee] I noticed that the sample code in this ticket is not quite right. You don't need to add
SearchBar
to theWindow
now because it's already added throughTableView.search
property. I have updated the description. It sounds kind of weird but I also noticed that adding components multiple times on iOS does not cause error in this case (but on Windows it throws exception), this may be an parity issue and should go to different ticket. I will add that one later on.[~kota] Your edits to the test case worked. I didn't see the error, and the fix that is related to this ticket also works. You can move it back to Resolved, since it was a revision to the demo code. I'll close the ticket once the 6.0.2 build comes through.
Tested with the following environment: NPM Version: 2.15.9 Node Version: 4.6.0 Windows OS: 10 Pro, Version 1607 Build 14393.693 Appc CLI: 6.1.0 Appc CLI NPM: 4.2.8 Titanium SDK version: 6.0.2.v20170213083448 Windows Device 8.1 (Lumia 640) Windows Device 10 (Lumia 650) I tested this with the latest SDK 6.0.2 and validated the fix. Specifically, I installed the demo app, and filtered for various rows. After filtering, I clicked on the row and an alert popped up.