Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-25177] Windows: Click on button in ListItem does not fire itemClick event

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionWon't Fix
Resolution Date2017-09-18T05:05:18.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsWindows
Labelsn/a
ReporterVictor Vazquez Montero
AssigneeKota Iguchi
Created2017-08-16T16:41:45.000+0000
Updated2018-08-02T22:20:08.000+0000

Description

Description

In windows, if a ListItem has a button in it, clicking the button does not fire ListView's itemClick event.

Steps to reproduce:

Run the attached Alloy project - TestListViewButton Click on rows in ListView outside button. Log statment will be printed as '[INFO] List View Item Click::: itemContainer' Click on buttons in ListView rows. No log statement will be printed.

Attachments

FileDateSize
TestListViewButton.zip2017-08-16T16:41:39.000+00007837264
tiinfo.txt2017-08-16T16:41:38.000+00007501

Comments

  1. Kota Iguchi 2017-08-22

    I have tested this on iOS with Titanium SDK 6.1.2.GA, but this doesn't work even on iOS too. So I would resolve this as "Won't fix" or "Invalid" because we always treat iOS as "reference platform". [~vvazquezmontero] Could you confirm this with customer?
  2. Victor Vazquez Montero 2017-08-24

    Thanks Kota I will share with the customer
  3. Kota Iguchi 2017-09-06

    [~vvazquezmontero] How about this; basic idea is to assign id to the buttons and then add click event listener to the buttons, and then get the id value from e.source.id.
       <Alloy>
       	<Window class="container">
       		<ListView id="listView" defaultItemTemplate="template" width="Ti.UI.FILL">
       			<Templates>
       				<ItemTemplate name="template">
       					<View bindId="itemContainer" width="Ti.UI.FILL" height="50" bindId="itemContainer">
       						<Button height="40" width="250" title="TEST BUTTON" backgroundColor="gray" color="white" bindId="button" onClick="onButtonClick"/>
       					</View>
       				</ItemTemplate>
       			</Templates>
       			<ListSection id="listSection"/>
       		</ListView>
       	</Window>
       </Alloy>
       
       (function init() {
         var listItems = []
         $.listSection.items = [];
       
         for (var i = 0; i < 10; i++) {
           listItems.push({
             template: 'template',
             itemContainer: {
               backgroundColor: (i % 2 === 0) ? 'red' : 'blue',
             },
             button: {
             	id: i,
             	title: 'TEST ' + i
             }
           });
         }
       
         $.listSection.items = listItems;
       })();
       
       function onButtonClick(e) {
         alert(e.type + ' ' + e.source.id);
       }
       
       $.index.open();
       
  4. Victor Vazquez Montero 2017-09-07

    Thank you [~kiguchi] I will share with the customer
  5. Kota Iguchi 2017-09-18

    Resolving this as "Won't Fix" because this doesn't work even on iOS and we have a workaround for this. Feel free to create new feature request if customer thinks this as important feature.
  6. Eric Merriman 2018-08-02

    Closing old "Won't fix" tickets. If you disagree, please reopen.

JSON Source