How to change text in tableview in OnRowTouch?

Hello,

I am trying to change the text when a row is touched in a tableview. I tried the code below in the onRowTouch and the rowTime was nil. Does anyone know how to do this without clearing all of the tableview rows and adding them again?

Thanks,

Warren

local function onRowTouch( event ) local phase = event.phase if ( "press" == phase ) then local row = event.row row.rowTime.text = "Test" end end local function onRowRender( event ) local phase = event.phase local row = event.row local groupContentHeight = row.contentHeight local Time2 = data[row.index].cardtime local rowTime = display.newText( row, Time2, 0, 0, native.systemFontBold, 32) rowTime.x = 10 rowTime.anchorX = 0 rowTime.y = groupContentHeight \* 0.5 rowTime:setFillColor( 0, 0, 0 ) end

Hi Warren,

It doesn’t seem that you’re adding “rowTime” as a parameter of “row”, so Lua doesn’t know it. Is this your complete code?

Thanks,

Brent

Hi Warren,

It doesn’t seem that you’re adding “rowTime” as a parameter of “row”, so Lua doesn’t know it. Is this your complete code?

Thanks,

Brent