Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-19130] Windows: Ti.UI.Window.remove() generates runtime error, view is not removed

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2015-07-02T19:29:12.000+0000
Affected Version/sRelease 4.1.0
Fix Version/sRelease 4.1.0
ComponentsWindows
Labelsn/a
ReporterFokke Zandbergen
AssigneeChristopher Williams
Created2015-07-01T11:27:59.000+0000
Updated2015-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

FileDateSize
Screen Shot 2015-07-01 at 13.23.41.png2015-07-01T11:27:32.000+000043578

Comments

  1. Fokke Zandbergen 2015-07-01

    There's no remove method here: https://github.com/appcelerator/titanium_mobile_windows/blob/master/Source/TitaniumKit/src/UI/View.cpp#L49-L52
  2. Christopher Williams 2015-07-01

    https://github.com/appcelerator/titanium_mobile_windows/pull/346
  3. Lokesh Choudhary 2015-07-06

    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

JSON Source