Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-9945] iOS: TableViewRow - Clicking in order at rows pulls down background image from 1st row to the 2nd

GitHub Issuen/a
TypeBug
PriorityLow
StatusClosed
ResolutionCannot Reproduce
Resolution Date2017-06-19T20:55:10.000+0000
Affected Version/sRelease 2.1.0, Release 3.1.0
Fix Version/sn/a
ComponentsiOS
Labelsapi, qe-testadded
ReporterTamila Smolich
AssigneeEric Merriman
Created2012-07-11T16:20:45.000+0000
Updated2017-06-19T20:55:10.000+0000

Description

Description: Clicking in order at rows pulls down background image from 1st row to the 2nd, when 2nd row should not have the background image. It happens if rows are clicked in order second time. Steps to reproduce: 1. Run the following code:
var win1 = Ti.UI.createWindow({  
    backgroundColor:'black'
});
 
var TheListBox=Ti.UI.createTableView({width:'auto'});

var BIRow=Ti.UI.createTableViewRow({
	color:'red',
	backgroundColor:"transparent",
	title:'No background image...click to toggle'
     });
                                    
                                    
var BIRow2=Ti.UI.createTableViewRow({
	color:'red',
	backgroundColor:"transparent",
	title:'No background image...click to toggle'
     });
                                   
 
BIRow.addEventListener('click',function()
//function ToggleBI()
{
  if (!BIRow.backgroundImage)
  {
    BIRow.backgroundImage='appicon.png';
    BIRow.title='Titanium background image...click to toggle';
  }
  else 
  {
    //BIRow.backgroundImage=null; // 1st test...NullPointerException
    BIRow.backgroundImage=''; // 2nd test...lockup/freeze...crash on next click
    BIRow.title='No background image...click to toggle';
  }
});

BIRow2.addEventListener('click',function()
//function ToggleBI2()
{
  if (!BIRow2.backgroundImage)
  {
   BIRow2.backgroundImage='KS_nav_ui.png';
   BIRow2.title='Titanium background image...click to toggle';
  }
  else 
  {
    BIRow2.backgroundImage=null; // 1st test...NullPointerException
    //BIRow2.backgroundImage=''; // 2nd test...lockup/freeze...crash on next click
    BIRow2.title='No background image...click to toggle';
  }
});

TheListBox.appendRow(BIRow);
TheListBox.appendRow(BIRow2);
win1.open();
win1.add(TheListBox);
2. Click in order on first and second rows 2 times Expected result: After second click on second row there should be no background image Actual result: Background image from first row appears in second row

Attachments

FileDateSize
iOS Simulator Screen shot Jul 11, 2012 4.17.39 PM.png2012-07-11T16:20:45.000+000020910

Comments

  1. jithinpv 2013-03-28

    Issue reproduces Tested with Titanium Studio, build: 3.0.1.201212181159 Titanium SDK version: 3.1.0 Titanium SDK version: 3.0.2 iOS iPhone Simulator: iOS SDK version: 6.0
  2. Lee Morris 2017-06-19

    I am unable to reproduce this issue with the following environment; iPhone 7 (10.2) Studio 4.9.0.201705302345 Ti SDK 6.1.1.v20170609091155 Appc NPM 4.2.9 Appc CLI 6.2.1 Ti CLI 5.0.13 Alloy 1.9.11 Arrow 2.0.0 Xcode 8.2 (8C38) Node v4.8.2 Java 1.8.0_131

JSON Source