Widget 2.0 Tableview Change From Daily Build 1073 On

Has there been a change in the tableview row render? When using categories I am getting the following error starting with Daily Build 1073 on. 

stack traceback: [C]: ? [C]: in function 'foreach' ...le\_Development/modules/module\_Caseload.lua:147: in function '\_onRowRender' ?: in function \<?:533\> ?: in function '\_renderCategory' ?: in function '\_manageRowLifeCycle' ?: in function \<?:365\> ?: in function \<?:218\>

Has there been a change in the tableview row render? When using categories I am getting the following error starting with Daily Build 1073 on. 

stack traceback: [C]: ? [C]: in function ‘foreach’ …le_Development/modules/module_Caseload.lua:147: in function ‘_onRowRender’ ?: in function <?:533> ?: in function ‘_renderCategory’ ?: in function ‘_manageRowLifeCycle’ ?: in function <?:365> ?: in function <?:218>

Hey Chevol, 

you know the drill :slight_smile: Would you please [buglink] with a small test case that exhibits this behavior and I will take a look. Cheers

Lol, yup will do. Thanks again for all your hard work Danny and Corona Labs!

Hey Chevol, 

did you submit a bug for this issue? I haven’t seen a case come in yet.

Thanks

No, not yet. We are demoing the app this upcoming week so been busy with that. If I have some time today I’ll do my best to come up with some code so I can submit a bug about this and the textbox ignoring width and not automatically wrapping. 

I have a similar problem on all tableviews in my application. It is now effectively useless since upgrading…

As an example I run this code:


– example taken from Blog post: “Creating Lists with the TableView Widget”


local widget = require “widget”

– create the tableView widget

local list = widget.newTableView{

    width = 320,

    height = 366

    }

– function below handles row rendering

local function onRowRender( event )

    print(“render”)

    local group = event.view

    local row = event.target

    

    local text = display.newText( “My first TableView row!”, 0, 0, native.systemFont, 18 )

    text:setReferencePoint( display.CenterLeftReferencePoint )

    text.x = 25

    text.y = row.height * 0.5

    

    – you must insert any display objects into event.view group

    group:insert( text )

end

local function onRowTouch(event)

    print(“touch”)

end

– insert the row

print(“inserting row !!!”)

list:insertRow{

    id = “unique-row-id”,

    onRender = onRowRender,

    onEvent = onRowTouch

}


The print statements in the touch and render functions don’t even register in the simulator console, meaning the functions aren’t called.

Also note that the “onRender” and “onEvent” parms have been removed from the object:insertRow() API documentation (http://docs.coronalabs.com/api/type/TableViewWidget/insertRow.html)

Is there any way to uninstall the latest version??? I’m dead right now…

The onRender function was moved to the tableView constructor, it’s not removed completely.

so for instance:

local tableView = widget.newTableView

{

    onRender = myRenderFunction,

}

Please read this http://forums.coronalabs.com/topic/33421-faq-updated-to-build-1034-or-greater-including-latest-public-release-widgets-no-longer-working-read-this-first/

Bug submitted (Case 22373)

Thanks again for all the work Danny, I promise to leave you alone soon  :smiley:

The aim is to get the widgets as close as possible to perfect, so please by all means keep reporting anything you find :slight_smile:

Has there been a change in the tableview row render? When using categories I am getting the following error starting with Daily Build 1073 on. 

stack traceback: [C]: ? [C]: in function ‘foreach’ …le_Development/modules/module_Caseload.lua:147: in function ‘_onRowRender’ ?: in function <?:533> ?: in function ‘_renderCategory’ ?: in function ‘_manageRowLifeCycle’ ?: in function <?:365> ?: in function <?:218>

Hey Chevol, 

you know the drill :slight_smile: Would you please [buglink] with a small test case that exhibits this behavior and I will take a look. Cheers

Lol, yup will do. Thanks again for all your hard work Danny and Corona Labs!

Hey Chevol, 

did you submit a bug for this issue? I haven’t seen a case come in yet.

Thanks

No, not yet. We are demoing the app this upcoming week so been busy with that. If I have some time today I’ll do my best to come up with some code so I can submit a bug about this and the textbox ignoring width and not automatically wrapping. 

I have a similar problem on all tableviews in my application. It is now effectively useless since upgrading…

As an example I run this code:


– example taken from Blog post: “Creating Lists with the TableView Widget”


local widget = require “widget”

– create the tableView widget

local list = widget.newTableView{

    width = 320,

    height = 366

    }

– function below handles row rendering

local function onRowRender( event )

    print(“render”)

    local group = event.view

    local row = event.target

    

    local text = display.newText( “My first TableView row!”, 0, 0, native.systemFont, 18 )

    text:setReferencePoint( display.CenterLeftReferencePoint )

    text.x = 25

    text.y = row.height * 0.5

    

    – you must insert any display objects into event.view group

    group:insert( text )

end

local function onRowTouch(event)

    print(“touch”)

end

– insert the row

print(“inserting row !!!”)

list:insertRow{

    id = “unique-row-id”,

    onRender = onRowRender,

    onEvent = onRowTouch

}


The print statements in the touch and render functions don’t even register in the simulator console, meaning the functions aren’t called.

Also note that the “onRender” and “onEvent” parms have been removed from the object:insertRow() API documentation (http://docs.coronalabs.com/api/type/TableViewWidget/insertRow.html)

Is there any way to uninstall the latest version??? I’m dead right now…

The onRender function was moved to the tableView constructor, it’s not removed completely.

so for instance:

local tableView = widget.newTableView

{

    onRender = myRenderFunction,

}

Please read this http://forums.coronalabs.com/topic/33421-faq-updated-to-build-1034-or-greater-including-latest-public-release-widgets-no-longer-working-read-this-first/

Bug submitted (Case 22373)

Thanks again for all the work Danny, I promise to leave you alone soon  :smiley:

The aim is to get the widgets as close as possible to perfect, so please by all means keep reporting anything you find :slight_smile:

Any updates? I am not seeing that error but the UI is still broken(Category text never shows on top most category row)

@chevol

This happens only if the first row in the tableview is a category.

Sometimes you’ll see that event.row.isCategory is nil when passed to your handler (instead of true/false).

As a test you can scroll the tableview down with your finger. The category text will become visible, but as soon as the tableview retracts to its default position the category text will disappear.

You can get around the issue by handling the nil exception.

@ingemar That’s the exact issue I am having! That also solved my issue, thanks!!!

Here is what I changed for anyone else having this issue:

if(event.row.isCategory==nil or row.isCategory)then --Render Category Row else --Render Row end