Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-24135] Windows: eventListener not maintained when a list is filtered based off a search

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2017-02-08T04:56:00.000+0000
Affected Version/sRelease 6.0.0
Fix Version/sRelease 6.0.2
ComponentsWindows
Labelsqe-6.0.0, regression
ReporterEwan Harris
AssigneeKota Iguchi
Created2016-11-10T18:03:34.000+0000
Updated2017-02-13T18:53:39.000+0000

Description

Description

*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();

Steps to reproduce

Add the above code to an existing app.js and build for Windows Platform

Search in the searchbar for something like 'third' and hit the return key

Tap the row

Actual result

Alert is not shown

Expected result

Alert should be shown

Comments

  1. Kota Iguchi 2017-01-17

    https://github.com/appcelerator/titanium_mobile_windows/pull/925
  2. Kota Iguchi 2017-01-24

    Cherry-pick for 6_0_X: https://github.com/appcelerator/titanium_mobile_windows/pull/932
  3. Abir Mukherjee 2017-01-25

    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.
  4. Kota Iguchi 2017-01-25

    I guess that's because Jenkins has failed to build the nightly SDK. Let me check and let you know when it's ready.
  5. Abir Mukherjee 2017-01-25

    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?
  6. Kota Iguchi 2017-01-25

    [~amukherjee] Yeah I was asking [~cwilliams] about it yesterday. I will let you know then. (y)
  7. Abir Mukherjee 2017-01-26

    [~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.
  8. Abir Mukherjee 2017-02-07

    [~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.
  9. Kota Iguchi 2017-02-08

    [~amukherjee] I noticed that the sample code in this ticket is not quite right. You don't need to add SearchBar to the Window now because it's already added through TableView.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.
  10. Abir Mukherjee 2017-02-08

    [~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.
  11. Abir Mukherjee 2017-02-13

    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.

JSON Source