[TIMOB-24360] Android: Cant clear TableView anymore
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Cannot Reproduce |
Resolution Date | 2019-08-05T17:13:37.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | n/a |
Labels | defect |
Reporter | Creative |
Assignee | Unknown |
Created | 2017-01-18T10:28:58.000+0000 |
Updated | 2019-08-05T17:13:37.000+0000 |
Description
Populate a Ti.UI.TableView with some rows, and try to remove them using:
$.myTableViewReference.setData([]);
// I also tried (which didnt work as well):
$.myTableViewReference.data = [];
I've attached a screenshot of the error I'm getting through Android Monitor (this doesnt show up in my Titanium console since the app just instantly dies).
As stated, this is on Android only. I'm not having these issues with the same code on iOS.
I was hoping to provide a testcase, but I cant reproduce it with a blank table like:
var x = Ti.UI.createTableView();
x.appendRow(Ti.UI.createTableViewRow());
x.data = [];
// The code above just works.
Attachments
File | Date | Size |
---|---|---|
Schermafbeelding 2017-01-18 om 11.18.59.png | 2017-01-18T10:22:36.000+0000 | 58769 |
Hello, I am testing the below code in Android and it works as expected.
I can clear the table view with the blank date like this. Both $.table.setData([]); and $.table.data = [];. Thanks.
hmm im positive it breaks in my (quite a bit bigger) situation. Perhaps try adding a clickhandler to the tableviewrows. I will try to debug the contents of the TableViewRow tomorrow, and see if any of that causes the issue. Sadly with this bug I cant deploy on SDK 6.0+. I will add to this bugreport soon.
Hello [~uzbbert], Did you checked? Get back to us.
yes im on it
i've managed to create a testcase:
This kills the application
Hello, I don't see the issue. with
I saw this error in console
But app opens fine. Thanks.
What are you testing on? I ran the snippet on an Android Z3 Compact (D5803) running Android 6.0.1. As soon as this code is executed the app dies (it completely exits). Also the Error you're getting in the console, isnt that worth further investigation?
Hello, I am testing on Galaxy J7 Android 6.0.1.
I've fixed this now in my situation, by simply re-assigning the
spacer
variable likeTableView.data = [spacer]
right after i've cleared the TableView. Still the sample code used to work on pre 6.0 SDK so I'm quite positive something has changed in the codebase that caused this. I expect the app to throw an error always, and that it should be impossible to completely kill the app due to a code error.I was facing this problem on Android 6 with SDK 6.0.2.GA. This was working fine with 5.5.2. I was re-using some rows and updating then on the TableView. To fix it, I'm just destroying and creating the row again. But this still an issue I think.