How do I insert the data from the SQL db into a table view?

Great to hear. Good luck with your app! 

Hello ksan,

I had a closer look at the code above that you cleaned up and corrected and would like to get some clarification.

In the tableView widget you commented out these lines:

–onRowTouch = onRowTouch,
–listener = scrollListener

and still the scrolling is working OK.

I had a look at the Corona Labs\Corona SDK\Sample Code\Interface\ScrollView example and in it there is a whole section to create a scroller which includes the listener:

[lua]

– Create a ScrollView
local scrollView = widget.newScrollView
{
    left = 0,
    top = 0,
    width = display.contentWidth,
    height = display.contentHeight,
    bottomPadding = 50,
    id = “onBottom”,
    horizontalScrollDisabled = true,
    verticalScrollDisabled = false,
    listener = scrollListener,
}

[/lua]

Does that mean that the scrolling is already included in the tableView widget and there is no need for any extra code to create scrolling?

Trying to learn as much as possible…

Thanks.

keram

Both tableView and scrollView know how to scroll on their own. You do not need additional code for scrolling. The reason there is an optional listener for scrolling is to cater for cases where you may need to do additional things to support your app design. Please read the API page for tableView. The onRowTouch and listener are marked Optional with a good explanation of what you use them for. 

The onRowTouch for example is demonstrated in the Widget Demo sample code. You use it to detect a touch in one of your rows and then branch off to a detail view screen etc. If you don’t need to do anything when your rows are touched then you don’t need to include the listener for it. 

Hope this helps.