Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-15451] iOS: ListView with custom Template in navigationWindow : listItems not displayed first time when calling appendSection()

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionDuplicate
Resolution Date2013-11-18T18:49:21.000+0000
Affected Version/sn/a
Fix Version/sRelease 3.2.0
ComponentsiOS
LabelsiOS7, listview, qe-closed-3.2.2
ReporterVincent
AssigneeShak Hossain
Created2013-10-10T07:24:07.000+0000
Updated2014-03-10T08:50:25.000+0000

Description

After setting a ListView with custom template in a navigation window, the listItems are not correctly displayed first time when you use appendSection(). Titanium SDK version 3.2.0.v20131009134844 : KO works with 3.1.4 See below for test case.

Comments

  1. Vincent 2013-10-10

    TEST CASE click on 'dataset' to display the listView in the second window: result : Section not displayed Go Back click again on dataset: the Sections are displayed
       
       detailTemplate = {
       	
           childTemplates: [
                  
               {                             
                   type: 'Ti.UI.Label',     
                   bindId: 'theName',          
                   properties: {            
                        
                     	color:'black',
                       font:{fontSize:14,fontWeight:'bold'},
       				top:1,
       				left:8,
       				
                   }
               },
               {                            
                   type: 'Ti.UI.Label',     
                   bindId: 'theCategorie',       
                   properties: {   
                   	             
                   	color:'darkGray',
                   	font:{fontSize:14,fontWeight:'bold'},
       				bottom:1,
       				left:8,
       								
                   }
               },
                   
           ]
       };
       
       
       var b1 = Ti.UI.createButton({
       	title : 'dataset1',
       	top:20,
       });
       
       
       b1.addEventListener('click', function() {
       	
       	var data1 = [
       
           	{ theName: { text: 'Row 1'},theCategorie:{ text: 'Cat 1'} },
           	{ theName: { text: 'Row 2'},theCategorie:{ text: 'Cat 2'} },
           	{ theName: { text: 'Row 3'},theCategorie:{ text: 'Cat 3'} }
           
           ];
           
            
       	var listSection1 = Titanium.UI.createListSection({items: data1,headerTitle: 'Data1 Custom Item Template'});
       	listView.appendSection(listSection1);
       	
       	 rootWin.openWindow(win2);
       });
       
       
       var win1= Ti.UI.createWindow({title:'Custom Item Template'});
       win1.add([b1,]);
       
       
       var win2 = Ti.UI.createWindow();
       
       var listView = Titanium.UI.createListView(
       	
       					{templates: { 'detailTemplate':detailTemplate },
       					defaultItemTemplate: 'detailTemplate',
       				}
       );
       	
       		
       listView.addEventListener('itemclick', function(e){
       	
       	//alert ( JSON.stringify(e));
       	Ti.API.info(JSON.stringify(e));
       	var item = e.section.getItemAt(e.itemIndex);
       	Ti.API.info(JSON.stringify(item));
       	
       		
       });
       
       win2.add(listView);
       
       var rootWin = Ti.UI.iOS.createNavigationWindow({window:win1});
       rootWin.open();
       
       
       
  2. Priya Agarwal 2014-03-10

    ListView with custom template working fine. Hence closing the issue. Used the below mentioned code to test. Appc Studio:3.2.2.201402280732 Sdk:3.2.2.v20140305122111 alloy:1.3.1 titanium:3.2.1 titanium-code-processor:1.1.0 Xcode: 5.1 Beta 5 Osx: Maverick(10.9.2) Device:iPod Touch3(v7.1 beta5)

JSON Source