I assigned a disclosure icon (the right pointing arrow) to each item in the list (iconR = 6), but the onIconPress event only seems to be looking for iconL, not iconR, tapping the icon on the right doesn’t trigger the event, tapping the space on the left where an icon would be if one were assigned does trigger it even though I specifically assigned iconL = 0,
–the table
for k,v in data:pairs() do
table.insert(tbl_List,
{
caption = v.name,
iconR = 6,
iconL = 0,
} )
end
—the GUI List
_G.GUI.NewList(
{
x = “center”,
y = “15%”,
width = “80%”,
height = “75%”,
parentGroup = group,
theme = “theme_3”,
name = “MY_LST”,
list = tbl_List,
itemHeight = 40,
allowDelete = true,
readyCaption = “Quit Editing”,
border = {“shadow”, 1,5, 64},
onSelect = function(EventData)
local List = EventData.List
local num = EventData.selectedIndex
print("right Icon: "… List[num].iconR)
end,
onIconPress = function(EventData)
print ("Icon pressed: " … EventData.selectedIndex)
end,
} )
—the print out when the right icon is pressed - this is the onSelect output
2013-06-24 22:53:39.755 Corona Simulator[504:707] right Icon: 6
—the printout when the area on the left of the list item is pressed - this is the onIconPress output
2013-06-24 22:53:35.366 Corona Simulator[504:707] Icon pressed: 1
This is a significant problem when you consider the importance of being able to select an item by tapping on it , as well as using the disclosure icon to open a detail window.