Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20301] Memory lack using scrollableview and many buttons. Buttons event don't works.

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionCannot Reproduce
Resolution Date2019-11-15T22:41:57.000+0000
Affected Version/sRelease 5.1.2
Fix Version/sn/a
Componentsn/a
Labels5.1.2, appcelerator, button, eventlistener, scrollableview
ReporterLorenzo Piccinini
AssigneeUnknown
Created2016-01-30T16:30:19.000+0000
Updated2019-11-15T22:41:58.000+0000

Description

With sdk 5.1.2 I try the code in new project on iPad2 simulator without LiveView and it works fine but not in my real project. Now, in the new project, I have tried with 90 iterations and clicks works for first 18 buttons, in 5.1.1 works fine in all buttons.
        var win = Ti.UI.createWindow({backgroundColor: 'white'});
	
	var data = [];
	var c =1;
	
	for(var i=1; i<=90; i++){
		
		if (c == 1) {
			var page_view = Ti.UI.createView({
				layout: 'horizontal'
			});
		}
	
		var view = Ti.UI.createView({
			backgroundColor: 'green',
			width : 250,
			left: 5
		});
	
	
	
		var button = Ti.UI.createButton({
			bottom : 10,
			left : 10,
			right : 10,
			height : 40,
			color : '#fff',
			backgroundColor : 'red',
			title : "click",
            ids: i
		});
	
	
		view.add(button);
	
	
		button.addEventListener('click', function(e) {
			Ti.API.info('button: ' + e.source.ids);
		});
		
		page_view.add(view);

		if (c % 3 == 0) {
			data.push(page_view);
			c = 1;
		} else {
			c++;

			if (i == 90) {
				data.push(page_view);
			}
		}

	}

	var scroll_view = Ti.UI.createScrollableView({
		showPagingControl : true,
		top : 130,
		views: data,
		layout: 'horizontal'
	});



	win.add(scroll_view);
http://stackoverflow.com/questions/35103130/multiple-buttons-dont-fire-clicks-event-5-1-2-memory-lack/35103813#35103813

Attachments

FileDateSize
Screen Shot 2016-01-31 at 11.36.07 AM.png2016-01-31T05:42:45.000+0000309246

Comments

  1. Sharif AbuDarda 2016-01-31

    Hello, I tried your project, It's working fine with SDk 5.1.2.GA. The buttons event is firing as expected. See the attachment. My Environment
       Operating System
         Name                        = Mac OS X
         Version                     = 10.11.2
         Architecture                = 64bit
         # CPUs                      = 4
         Memory                      = 8589934592
       Node.js
         Node.js Version             = 4.2.2
         npm Version                 = 2.14.7
       Titanium CLI
         CLI Version                 = 5.0.5
       Titanium SDK
         SDK Version                 = 5.1.2.GA
         Target Platform             = ipad 2
       
    Thanks.
  2. Lorenzo Piccinini 2016-01-31

    I have recorded video example. Download here http://smartappsdesign.com/Test.mov
  3. Sharif AbuDarda 2016-02-01

    Hello, Test on a real device. and make a video of the response. The issue is not reproducible from my end with SDK 5.1.2.GA. Thanks.
  4. Lorenzo Piccinini 2016-02-01

    Yes, I confirm the problem on device too. http://smartappsdesign.com/TestDevice.m4v
  5. Alan Hutton 2019-11-15

    Cannot reproduce. Closing. Axway Appcelerator Studio, build: 5.1.4.201909061933  macOS : 10.15 Node.js Version : 8.9.1 npm Version : 5.5.1 Appcelerator CLI : 7.1.1 Titanium CLI CLI Version : 5.2.1 node-appc Version : 0.2.49 Titanium SDKs : 8.2.1.GA

JSON Source