There is no longer event.id.
In your row render function you should have something like this:
[code]
local row = event.target
print( row.id ) – this is the row id
[/code] [import]uid: 84637 topic_id: 36210 reply_id: 145195[/import]
There is no longer event.id.
In your row render function you should have something like this:
[code]
local row = event.target
print( row.id ) – this is the row id
[/code] [import]uid: 84637 topic_id: 36210 reply_id: 145195[/import]
Thank you. I tried that before as well, but when I do that I just get:
2013-03-06 16:23:16.875 Corona Simulator[5222:707] widget_tableView
2013-03-06 16:23:16.876 Corona Simulator[5222:707] widget_tableView
2013-03-06 16:23:16.876 Corona Simulator[5222:707] widget_tableView
2013-03-06 16:23:16.876 Corona Simulator[5222:707] widget_tableView
etc
The code being:
local widget = require “widget”
local function onRowRender(event)
local row = event.target
print( row.id ) – this is the row id
end
local list = widget.newTableView
{
width = display.contentWidth,
height = display.contentHeight,
onRowRender = onRowRender,
}
for i = 1, 20 do
list:insertRow
{
id = “this is my variable”,
height=60,
lineColor={115, 185, 255},
}
end
Should the above be returning the id that I have in my insertRow?
Thank you!
Dougi [import]uid: 155864 topic_id: 36210 reply_id: 145202[/import]
Hey Doug.
Sorry, I read your initial question wrong.
This is what you want:
local row = event.row
print( row.id )
Sorry about that. [import]uid: 84637 topic_id: 36210 reply_id: 145203[/import]
Hey PXL.
You are correct. Would you be so kind as to file a bug about this so I can keep track of it here?: http://developer.coronalabs.com/content/bug-submission
You don’t need to provide a test case, just the information you posted in this thread is more than enough.
Thank you [import]uid: 84637 topic_id: 36210 reply_id: 143839[/import]
Ok, submitted.
By the way, I see in the documentation and examples of the new tableView, a event.phase returned from listener, onRowTouch and onRowRender.
I think there’s no event.phase on a onRowRender (returns nil).
[import]uid: 9158 topic_id: 36210 reply_id: 143840[/import]
Thanks.
I will look into that also, and again if you would report a bug on that also great!
Thanks for the reports, it will help get these teething problems sorted out asap. [import]uid: 84637 topic_id: 36210 reply_id: 143841[/import]
Hey PXL.
You are correct. Would you be so kind as to file a bug about this so I can keep track of it here?: http://developer.coronalabs.com/content/bug-submission
You don’t need to provide a test case, just the information you posted in this thread is more than enough.
Thank you [import]uid: 84637 topic_id: 36210 reply_id: 143839[/import]
Ok, submitted.
By the way, I see in the documentation and examples of the new tableView, a event.phase returned from listener, onRowTouch and onRowRender.
I think there’s no event.phase on a onRowRender (returns nil).
[import]uid: 9158 topic_id: 36210 reply_id: 143840[/import]
Thanks.
I will look into that also, and again if you would report a bug on that also great!
Thanks for the reports, it will help get these teething problems sorted out asap. [import]uid: 84637 topic_id: 36210 reply_id: 143841[/import]
Hi
I am having the same problem. I can’t see a way of looping data into a TableView now. Before I would have just passed the data as a table in the id field.
Is there a workaround or an ETA for a fix please?
Thank you
Dougi [import]uid: 155864 topic_id: 36210 reply_id: 145185[/import]
Hey guys,
I wasn’t aware the sample was broken, will get it fixed.
There is already a id that can be assigned to tableView rows ( from daily build 1040 onwards ),
tableView:insertRow{
id = "whateverIdYouWant",
}
[import]uid: 84637 topic_id: 36210 reply_id: 145186[/import]
Ooo, thanks, that sounds like it may solve it. I’m on build 1038, so I’ll update.
Does it support passing a table of values?
Thanks so so much for your quick response. You guys are great! [import]uid: 155864 topic_id: 36210 reply_id: 145187[/import]
Thanks Danny. I think I am being thick here, but I am not sure where I am going wrong. I have the following and am using the latest daily build 2013.1043
local widget = require “widget”
local function onRowRender(event)
print(event.id)
end
local list = widget.newTableView
{
width = display.contentWidth,
height = display.contentHeight,
onRowRender = onRowRender,
}
for i = 1, 20 do
list:insertRow
{
id = “this is my variable”,
height=60,
lineColor={115, 185, 255},
}
end
I get a print out of the looped items, but the print just says “nil” e.g.
2013-03-06 14:57:34.395 Corona Simulator[5222:707] nil
2013-03-06 14:57:34.395 Corona Simulator[5222:707] nil
2013-03-06 14:57:34.396 Corona Simulator[5222:707] nil
2013-03-06 14:57:34.396 Corona Simulator[5222:707] nil
2013-03-06 14:57:34.396 Corona Simulator[5222:707] nil
etc
If I try and add the onRender to the insertRow it doesn’t do anything at all.
Could you please show me what I’m doing wrong here?
Thank you and sorry if this is a basic question.
Dougi
[import]uid: 155864 topic_id: 36210 reply_id: 145193[/import]
There is no longer event.id.
In your row render function you should have something like this:
[code]
local row = event.target
print( row.id ) – this is the row id
[/code] [import]uid: 84637 topic_id: 36210 reply_id: 145195[/import]
Thank you. I tried that before as well, but when I do that I just get:
2013-03-06 16:23:16.875 Corona Simulator[5222:707] widget_tableView
2013-03-06 16:23:16.876 Corona Simulator[5222:707] widget_tableView
2013-03-06 16:23:16.876 Corona Simulator[5222:707] widget_tableView
2013-03-06 16:23:16.876 Corona Simulator[5222:707] widget_tableView
etc
The code being:
local widget = require “widget”
local function onRowRender(event)
local row = event.target
print( row.id ) – this is the row id
end
local list = widget.newTableView
{
width = display.contentWidth,
height = display.contentHeight,
onRowRender = onRowRender,
}
for i = 1, 20 do
list:insertRow
{
id = “this is my variable”,
height=60,
lineColor={115, 185, 255},
}
end
Should the above be returning the id that I have in my insertRow?
Thank you!
Dougi [import]uid: 155864 topic_id: 36210 reply_id: 145202[/import]
Hey Doug.
Sorry, I read your initial question wrong.
This is what you want:
local row = event.row
print( row.id )
Sorry about that. [import]uid: 84637 topic_id: 36210 reply_id: 145203[/import]
Thank you, that worked. I had actually tried that, but for some reason it wasn’t working in my scene. I then started again, rebuilding it bit by bit and presto. So I must have had something else in there that was causing problems.
Thank you for your help! [import]uid: 155864 topic_id: 36210 reply_id: 145267[/import]
Hello again. I think I figured out what’s going on. I had tried as you said here, but I had taken the code from the documentation here:
http://docs.coronalabs.com/api/library/widget/newTableView.html
The example shows the following code for referencing the row in the onRowRender function:
local row = event.target
local rowGroup = event.view
It seems that this is now obsolete and has been replaced by a single object “row”, so referencing it and inserting into it are all done on the same object.
So I think the code in the example should be:
local row = event.row
Does this sound correct? It appears to work for me. [import]uid: 155864 topic_id: 36210 reply_id: 145270[/import]
Just a follow up as well. I find (and have had feedback from users) that the listView is very (and I mean very) unresponsive to touch when selecting items in the list when used on Android.
This is such a problem that I am using a widgetCandy list for most selection lists now. This is significantly more responsive, but doesn’t have the same flexibility or performance (especially on iOS) that your listView has.
Do you have any workarounds that make the corona listView widget more responsive on Android?
My warmest thanks. [import]uid: 155864 topic_id: 36210 reply_id: 145290[/import]