Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-17550] Android: ListView methods getSections() and properties sections return nothing/undefined

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-08-29T17:52:10.000+0000
Affected Version/sRelease 3.3.0
Fix Version/sRelease 3.4.0
ComponentsAndroid
Labels3.3.0.GA, TCSupport, android, getSection, ios, listSections, listView, listiSection, module_listview, qe-testadded, regression, sections
ReporterLibera
AssigneeHieu Pham
Created2014-08-04T15:17:41.000+0000
Updated2014-10-13T20:52:30.000+0000

Description

Problem Description

I see, that on iOS listView.getSections(0) and listView.sections[0] return [object TiUIListSection] while on Android listView.getSections(0) return nothing and listView.sections[0] returns undefined on Titanium 3.3.0GA. On Titanium 3.2.3GA this code work fine on both platform, iOS and Android, but now it works only on iOS.

Steps to reproduce

- Create a Classic Titanium project - Paste the testcase into app.js - Run this with testing environment - Check the logs in Ti Studio

Testcase

var data = {
	properties : {
		title : "Sample"
	}
};
var listView = Titanium.UI.createListView({});
var listSections = Titanium.UI.createListSection({});
listSections.setItems([data]);
listView.setSections([listSections]);
Ti.API.info(listView.sections[0]);//undefined
Ti.API.info(listView.sections[0].items);//ERROR
Ti.API.info(listView.sections[0].items.length); //ERROR

Actual Results

On Android listView.getSections(0) return nothing and listView.sections[0] returns undefined on Titanium SDK 3.3.0GA.

Comments

  1. jithinpv 2014-08-28

    Issue reproduces in Titanium SDK version 3.4.0 master, 3.3.0.GA But works fine in Titanium SDK version 3.2.3.GA Titanium Studio, build: 3.3.0.201407100905 Titanium Command-Line Interface CLI version 3.3.0, Android device : Motorola Moto G, Android version : 4.4.4
  2. Ingo Muschenetz 2014-08-28

    Hieu, can you please take a look?
  3. Hieu Pham 2014-08-28

  4. Lokesh Choudhary 2014-08-29

    Verified the fix. Now, listView.sections[0] returns ----- [object ListSection] listView.sections[0].items returns----- [object Object] listView.sections[0].items.length returns ----- 1 Closing. Environment: Appc Studio : 3.4.0.201408282203 Ti SDK : 3.4.0.v20140829104912 Mac OSX : 10.9.4 Alloy : 1.5.0-dev CLI - 3.4.0-dev Code Processor: 1.1.1 Android 4.4.4 -Nexus 5

JSON Source