Here is the code where the params get set.
local i = 1
local myData = {}
for Hatch in insects:nrows(sqlHatched) do
if (latin == true) then
myData[i] =
{
rowtitle = Hatch.OrdName …" " … Hatch.FamilyName,
rowsubtitle = Hatch.Genus …" “… Hatch.Species,
rowinsimage = Hatch.GenAdImg
}
else
myData[i] =
{
rowtitle = Hatch.FamilyName…” " … Hatch.Genus,
rowsubtitle = Hatch.OrdDesc …" - " … Hatch.DunPattern,
rowinsimage = Hatch.GenAdImg
}
end
i= i + 1
end
–had to do this outside the for loop because of a tail call error
local tableEmerge = widget.newTableView (tableEmergeOptions)
for i = 1, #myData do
tableEmerge:insertRow
{
isCategory = false,
rowHeight = 80,
params =
{
title = myData[i].rowtitle,
subtitle = myData[i].rowsubtitle,
– insimage = ‘"images/’…myData[i].rowinsimage…’"’
insimage = ‘"’…string.upper(myData[i].rowinsimage)…’"’
}
}
end
PLEASE note the commented line where I’ve tried various string alternatives
HERES the Error
params.img = “NIA.PNG”
WARNING: Failed to find image(“NIA.PNG”)
Runtime error
c:\users\david fisher\documents\corona projects\hatchingthematch\db\main.lua:149: attempt to index field ‘img’ (a nil value)
stack traceback:
c:\users\david fisher\documents\corona projects\hatchingthematch\db\main.lua:149: in function ‘_onRowRender’
?: in function ‘_createRow’
?: in function <?:1116>
(tail call): ?
c:\users\david fisher\documents\corona projects\hatchingthematch\db\main.lua:230: in function ‘fetchEmerge’
AND Here’s the code in the onRowRender function that causes the error
142 local params = event.row.params
143 if ( event.row.params ) then
144 print( "params.img = "…params.insimage )
145 print( "params.title = "…params.title )
146 print( "params.subtitle = "…params.subtitle )
147 local rowgroup = display.newGroup( )
148 row.img = display.newImage( params.insimage )
149 row.img.x = math.floor(row.img.width*0.5 + 6)
150 row.img.y = math.floor(row.img.height*0.5)
hope thos is what you were requesting