tableView params working for anyone?

I’m setting up the params table when I insert rows into a tableView

[lua]

        tableView:insertRow

        {

            isCategory = isCategory,

            rowHeight = rowHeight,

            rowColor = rowColor,

            lineColor = lineColor,

            params = { foo = false }

        }

[/lua]

…and it all seems to go well, but when I try to access params inside onRowRender() it gives me an error. Says field params is nil. I’m accessing it like this:

[lua]

if event.row.params.foo then

[/lua]

What’s really confusing is that if I take a look at the event.row table, I see the params table is there.

Has anyone successfully used the params part of tableView? I’m using the github version of v2 widgets (downloaded the latest version just a few days ago). Also tried it with the built-in widgets in SDK build 1178 and got the same results.

 Jay

Hi Jay,

I have this working in build 1170, calling it exactly like you’re doing, so I’m not sure what’s going on. Out of curiosity, what if you set “foo” to a string instead of false? Does it still report nil? Maybe there’s some kind of “false = nil” thing going on internally…

Brent

Man, I hoped that’s all it was, but changing foo to a string did nothing. 

So I started cutting out everything that wasn’t necessary so I could post the whole file here – and found the problem. :slight_smile:

The params table is apparently not attached to rows where isCategory is set to true. So you can’t just check for the value of something in that table inside onRowRender – if you’re using categories you need to check only in those rows that are data rows.

Could be a design decision that I disagree with, but to me that smells like a bug. Yes? No?

 Jay

I agree, this shouldn’t be the behavior… category rows may need parameters too. I’ll forward this to the engineers to get a fix pushed in.

Thanks,

Brent

Great catch!

Hi Jay,

I have this working in build 1170, calling it exactly like you’re doing, so I’m not sure what’s going on. Out of curiosity, what if you set “foo” to a string instead of false? Does it still report nil? Maybe there’s some kind of “false = nil” thing going on internally…

Brent

Man, I hoped that’s all it was, but changing foo to a string did nothing. 

So I started cutting out everything that wasn’t necessary so I could post the whole file here – and found the problem. :slight_smile:

The params table is apparently not attached to rows where isCategory is set to true. So you can’t just check for the value of something in that table inside onRowRender – if you’re using categories you need to check only in those rows that are data rows.

Could be a design decision that I disagree with, but to me that smells like a bug. Yes? No?

 Jay

I agree, this shouldn’t be the behavior… category rows may need parameters too. I’ll forward this to the engineers to get a fix pushed in.

Thanks,

Brent

Great catch!

This bug is still actually happening… When passing params into a category row params is nil…

Yes. Can you believe it! It was identified as a regression bug and still not taken care of after so many months… Tsk tsk tsk.

This bug is still actually happening… When passing params into a category row params is nil…

Yes. Can you believe it! It was identified as a regression bug and still not taken care of after so many months… Tsk tsk tsk.