More than one List View in an app?

Hello,

New to Corona and trying to follow some of the examples and write some test apps. I searched the forums and couldn’t find an answer to this one.

Using the ListView apps in the sample code of the SDK, and version 1.7 of the TableView library (tableView.lua), I put together an app with two list views, clicking on an item in the first list brings up the second list. This is where I run into a problem.

No matter what I try, I can only get ONE of the two lists to scroll. It’s always the second one created in the code. If I reverse their declarations, the other one scrolls. At first I thought it required two variable declarations so tried something like this:

local tblView1 = require(“tableView”)
local tblView2 = require(“tableView”)

and used those, but still only the one table will scroll. Is this a limitation of the tableView code that I should try and change or a limitation of the Android OS? Anyone successfully put two or more lists in an application and have them scroll okay?
[import]uid: 47399 topic_id: 8304 reply_id: 308304[/import]

I just found this post deep in the forum with a similar question to mine:

http://developer.anscamobile.com/forum/2010/10/08/tableview-question-multiple-lists

Hmmm, the fact that his went unanswered makes me wonder if it cannot be done? :wink:
[import]uid: 47399 topic_id: 8304 reply_id: 29592[/import]

Okay, so I am talking to myself, but hopefully this helps someone…

I just had an idea and it worked! I copied tableView.lua and called the copy tableView2.lua, then changed my declarations to this:

local tblView1 = require(“tableView”)
local tblView2 = require(“tableView2”)

And now both list views scroll independently. Question for the Corona folks - is this by design?

If so, I guess I am having issues with a new way of looking at coding. Being a .NET developer, I assumed creating two variables of the tableView.lua meant two “instances” of it, as in class objects. But I guess you need two actual files to accomplish this?

Or is there a better way?

Appreciate any help. [import]uid: 47399 topic_id: 8304 reply_id: 29593[/import]

i think this is an oversight in the original code. I would wait for the new Corona UI which should be released soon
[import]uid: 6645 topic_id: 8304 reply_id: 29681[/import]