Widget 2.0 - TableView insertRow id

Hey Doug.

We tested on android extensively and didn’t have any issues with touch response.

Can you tell me what devices this issue was reported on?
Thanks [import]uid: 84637 topic_id: 36210 reply_id: 145291[/import]

I tested on HTC Sensation, but users have been using all sorts of devices. I’ve had issues reported numerous times and this is the one big thing that keeps coming back to me from the app.

I assume that I am implementing it correctly by using onRowTouch.

It works beautifully on iOS. As far as I know it always fails on Android. I tried it again with the new build and the widget demo provided with the SDK and had exactly the same experience as in my version.

Does that help at all? [import]uid: 155864 topic_id: 36210 reply_id: 145292[/import]

I see.

Did this happen for you from the first version of widgets 2.0 (in daily build 1038) or is this a recent issue?

Either way I will look into this. [import]uid: 84637 topic_id: 36210 reply_id: 145294[/import]

It seems to happen for both versions. It was a problem with the first version of the app I built (not sure which version of the SDK I was on at that point). It also seems to happen with the latest build and the widget example code that you guys give in the SDK.

Thank you for looking into this. It’s causing me a lot of headaches, so it would be brilliant if we can find a way around it. [import]uid: 155864 topic_id: 36210 reply_id: 145296[/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]

@Doug, it should do :wink: [import]uid: 84637 topic_id: 36210 reply_id: 145189[/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]

Hey Doug.

We tested on android extensively and didn’t have any issues with touch response.

Can you tell me what devices this issue was reported on?
Thanks [import]uid: 84637 topic_id: 36210 reply_id: 145291[/import]

I tested on HTC Sensation, but users have been using all sorts of devices. I’ve had issues reported numerous times and this is the one big thing that keeps coming back to me from the app.

I assume that I am implementing it correctly by using onRowTouch.

It works beautifully on iOS. As far as I know it always fails on Android. I tried it again with the new build and the widget demo provided with the SDK and had exactly the same experience as in my version.

Does that help at all? [import]uid: 155864 topic_id: 36210 reply_id: 145292[/import]

I see.

Did this happen for you from the first version of widgets 2.0 (in daily build 1038) or is this a recent issue?

Either way I will look into this. [import]uid: 84637 topic_id: 36210 reply_id: 145294[/import]

It seems to happen for both versions. It was a problem with the first version of the app I built (not sure which version of the SDK I was on at that point). It also seems to happen with the latest build and the widget example code that you guys give in the SDK.

Thank you for looking into this. It’s causing me a lot of headaches, so it would be brilliant if we can find a way around it. [import]uid: 155864 topic_id: 36210 reply_id: 145296[/import]