[TIMOB-19130] Windows: Ti.UI.Window.remove() generates runtime error, view is not removed
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Critical |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2015-07-02T19:29:12.000+0000 |
Affected Version/s | Release 4.1.0 |
Fix Version/s | Release 4.1.0 |
Components | Windows |
Labels | n/a |
Reporter | Fokke Zandbergen |
Assignee | Christopher Williams |
Created | 2015-07-01T11:27:59.000+0000 |
Updated | 2015-07-06T21:29:38.000+0000 |
Description
The following example shows that you cannot remove a view on Windows:
var win = Ti.UI.createWindow();
var view = Ti.UI.createView({
top: 100,
width: 100,
height: 100,
backgroundColor: 'red'
});
win.add(view);
var btn = Ti.UI.createButton({
top: 300,
title: 'Click'
});
btn.addEventListener('click', function (e) {
win.remove(view);
});
win.add(btn);
win.open();
Log:
-- Start application log -----------------------------------------------------
[INFO] Finished launching the application
[INFO] Waiting for app to connect to log relay
[ERROR] Application Error: "Runtime Error during click event: undefined is not a function (evaluating 'win.remove(view)')"
Attachments
File | Date | Size |
---|---|---|
Screen Shot 2015-07-01 at 13.23.41.png | 2015-07-01T11:27:32.000+0000 | 43578 |
There's no
remove
method here: https://github.com/appcelerator/titanium_mobile_windows/blob/master/Source/TitaniumKit/src/UI/View.cpp#L49-L52https://github.com/appcelerator/titanium_mobile_windows/pull/346
Verified the fix. Ti.UI.Window.remove() does not generate any runtime error. Closing. Environment: Appc Studio: 4.1.0.201507031129 Ti SDK: 4.1.0.v20150706111546 Ti CLI: 4.0.1 Alloy: 1.6.2 Windows: 8.1 Enterprise 64-bit APPC NPM: 4.1.0-1 APPC CLI: 4.1.0-5 Device: Nokia Lumia 928 - Windows Phone 8.1 Windows emulator : 8.1