Tableview Click and Categories Giving Error

I am trying to display a file based on which item in a tablevew they are picking.

This works - right now I’m just using PRINT to see the results in the OUTPUT window, but it works fine when I click on a normal entry.

When I click on a CATEGORY, it blows up.  It gives me an error that "attempt to index local ‘params’ (a nil value)

 if phase == "ended" and event.y \< startYpos + buffer and event.y \> startYpos - buffer and event.x \< startXpos + buffer and event.x \> startXpos - buffer then --native.showAlert("Row " .. row.index, "Selected") if params.isCat == false then print ("Row " .. params.sub .. " Selected " .. params.name) else print("category") end end

Any ideas?  Is there any way I can tell that it’s a category before I make this check?

Hi John,

It appears that you’re already checking this via your “params.isCat” condition. Do you apply that property to every row (true or false) when you create the rows for the table view?

Brent

Hi Brent,

Yes, I apply that to each row.  But it seems to not even see Params for categories.

I think I found a workaround tho.  I’m testing to see if params is nil and if so, I ignore it, otherwise I display the results.  That seems to work.

Hi John,

It appears that you’re already checking this via your “params.isCat” condition. Do you apply that property to every row (true or false) when you create the rows for the table view?

Brent

Hi Brent,

Yes, I apply that to each row.  But it seems to not even see Params for categories.

I think I found a workaround tho.  I’m testing to see if params is nil and if so, I ignore it, otherwise I display the results.  That seems to work.