[TIMOB-14774] Android: Adding button to tableViewRow prevents row touch events
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Invalid |
Resolution Date | 2013-08-26T21:12:52.000+0000 |
Affected Version/s | Release 2.1.4, Release 3.1.0, Release 3.1.1 |
Fix Version/s | 2013 Sprint 18, 2013 Sprint 18 API |
Components | Android |
Labels | android, ipass1, mobile, mobilesdk, titanium, triage |
Reporter | Ashish Nigam |
Assignee | Ping Wang |
Created | 2013-08-07T09:51:06.000+0000 |
Updated | 2017-03-28T20:26:31.000+0000 |
Description
Adding button object to tableViewRow prevents tableViewRow Object touch or click events.
Steps to reproduce:
1: Use the below mentioned code in a alloy project.
**index.js**
function doClick(e) {
alert($.tableView);
}
function doClick1(e) {
alert("$.tableView");
}
$.index.open();
**index.xml**
<Alloy>
<Window class="container">
<TableView id="label" onClick="doClick">Hello, World
<TableViewRow id='row' class='row' className= 'categoryRow' width='Ti.UI.FILL'>
<Label id="categoryName" width = '150' text="touch test" left = '150' touchEnabled="false"/>
<Button id="categoryCount" onClick="doClick1" right = '225' width="40" height="50" backgroundColor="red" touchEnabled="false"/>
<ImageView id="rightImage" height='Ti.UI.SIZE' width='Ti.UI.SIZE' image='/appicon.png' right='0' touchEnabled="false"/>
</TableViewRow>
</TableView>
</Window>
</Alloy>
**index.tss**
".container": {
backgroundColor: "white"
},
"Label": {
width: Ti.UI.SIZE,
height: Ti.UI.SIZE,
color: "#000"
},
"#row":{
backgroundColor: 'white',
height: 150,
backgroundSelectedColor: 'red'
}
2: Test the app in any android device, preferred is android version 4.1.2 device.
3: tapping on tableView row does not change the selectedBackgroundColor.
**now change the Button to View in index.xml**
and repeat the steps, everything works fine.
Also reproducible using Titanium Standard project. **sample code**
This is a native Android behavior. Add
to the above test case will make the click event works on both the button and the table view row. Here are some similar posts: http://stackoverflow.com/questions/7763983/how-to-do-button-click-and-list-view-item-click-in-customize-list-view-in-androi http://stackoverflow.com/questions/3045872/listview-and-buttons-inside-listview Resolve the ticket as Invalid.