tableView deleteRow still not working after months

I keep getting this error when trying to delete a row from my tableView.  This was reported back in July and still no fix.  I NEED this fixed as I cannot release my app without it.

I am using a button and it tries to delete the row on release of the button.  The button is not part of the tableView group.

Even the documentation code for deleteRow doesn’t work!

Runtime error
?:0: attempt to index field ‘_scrollBar’ (a nil value)
stack traceback:
        [C]: ?
        ?: in function <?:1041>
        (tail call): ?
        …corona games\ps\favourites.lua:1139: in function ‘_onRelease’
        ?: in function ‘?’
        ?: in funct

Is it something specific you are doing? After the tableView fixes few weeks back I have been deleting rows without problem.

Hi Jon,

Here’s what I’ve found. Using windows simulator.

Having hideScrollBar = true, causes this error all the time.

If I have hideScrollBar = false, I can then only delete the row using a timer delay of 1.

The reason I need the hideScrollBar = true is because the scrollBar does not update if you add a new row to the table, which I’ve sent a bug report about last week.

I’m really stuck with this.

Here’s some sample code:

[lua]

local widget = require( “widget” )

local function onRowRender(event)
    
    local row = event.row
    local rowind = row.index
    
    local rownum = display.newText(row,"Row: "…rowind,20,20,native.systemFont,12)
    rownum:setTextColor(0)
end

– Create a tableView
local tableView = widget.newTableView
{
    left = 0,
    top = 0,
    width = 320,
    height = 480,
    listener = tableViewListener,
    onRowRender = onRowRender,
    hideScrollBar = true,
}

– Create 100 rows
for i = 1, 100 do
    local isCategory = false
    local rowHeight = 40
    local rowColor =
    {
        default = { 255, 255, 255 },
        over = { 255, 0, 255 },
    }
    local lineColor = { 220, 220, 220 }

    

    – Insert the row into the tableView
    tableView:insertRow
    {
        isCategory = isCategory,
        rowHeight = rowHeight,
        rowColor = rowColor,
        lineColor = lineColor,
    }
end

– Delete the tenth row in the tableView
–local function deletetherow()
    tableView:deleteRow( 10 )
–end

–timer.performWithDelay(1, deletetherow ,1)

[/lua]

Ahh ok. I tried adding hideScrollBar = true to my project and delete a row and got the same error.

Thanks Jon for confirming.

If coronalabs would update the scrollBar upon creating a new row then I wouldnt have to hide the scrollBar.

So trying to avoid one bug in tableView means I encounter a different bug which causes my tableView to be unworkable at the moment.

I’m very close to release and need either or both of these fixed please.

Is there a bug report number for this?

Hi Rob,  the bug report number is 26423 for the tableView scrollBar not updating after new rows are created.

Thanks

Thank you

Anybody know if this has been fixed yet? It seems to affect the deletion if you have .isLocked set on the tableView as well.

Build 1228

Do you have  a bugID I could look up?

Is it something specific you are doing? After the tableView fixes few weeks back I have been deleting rows without problem.

Hi Jon,

Here’s what I’ve found. Using windows simulator.

Having hideScrollBar = true, causes this error all the time.

If I have hideScrollBar = false, I can then only delete the row using a timer delay of 1.

The reason I need the hideScrollBar = true is because the scrollBar does not update if you add a new row to the table, which I’ve sent a bug report about last week.

I’m really stuck with this.

Here’s some sample code:

[lua]

local widget = require( “widget” )

local function onRowRender(event)
    
    local row = event.row
    local rowind = row.index
    
    local rownum = display.newText(row,"Row: "…rowind,20,20,native.systemFont,12)
    rownum:setTextColor(0)
end

– Create a tableView
local tableView = widget.newTableView
{
    left = 0,
    top = 0,
    width = 320,
    height = 480,
    listener = tableViewListener,
    onRowRender = onRowRender,
    hideScrollBar = true,
}

– Create 100 rows
for i = 1, 100 do
    local isCategory = false
    local rowHeight = 40
    local rowColor =
    {
        default = { 255, 255, 255 },
        over = { 255, 0, 255 },
    }
    local lineColor = { 220, 220, 220 }

    

    – Insert the row into the tableView
    tableView:insertRow
    {
        isCategory = isCategory,
        rowHeight = rowHeight,
        rowColor = rowColor,
        lineColor = lineColor,
    }
end

– Delete the tenth row in the tableView
–local function deletetherow()
    tableView:deleteRow( 10 )
–end

–timer.performWithDelay(1, deletetherow ,1)

[/lua]

Ahh ok. I tried adding hideScrollBar = true to my project and delete a row and got the same error.

Thanks Jon for confirming.

If coronalabs would update the scrollBar upon creating a new row then I wouldnt have to hide the scrollBar.

So trying to avoid one bug in tableView means I encounter a different bug which causes my tableView to be unworkable at the moment.

I’m very close to release and need either or both of these fixed please.

Is there a bug report number for this?

Hi Rob,  the bug report number is 26423 for the tableView scrollBar not updating after new rows are created.

Thanks

Thank you

Anybody know if this has been fixed yet? It seems to affect the deletion if you have .isLocked set on the tableView as well.

Build 1228

Do you have  a bugID I could look up?