Forum Discussion

arifkhan's avatar
arifkhan
Visitor
11 years ago

roLIstScreen is not working properly

I am developing a channel which has a roListScreen which is called recursively.
I am creating listscreen using the same function again and again.
Whenever next ListScreen is created in stack and I return back to the previous screen ,
reference of previous screen is lost and event does not work here.
Please provide me solution so that I can create multiple roListScreen with same function and can handle remote event for each screen.
I dont want to make a different function for each listScreen.

Sample code is given below:

Function appMenuScreen(id as String, title as String) As Dynamic

print "showListScreen Started"
screen = CreateObject("roListScreen")
port = CreateObject("roMessagePort")
screen.SetMessagePort(port)
screen.SetHeader(Title)
menuJson = getJson(m.menuURL + id)
screen.SetContent(menuJson.categories)
screen.show()


while (true)
msg = wait(0, port)
if (type(msg) = "roListScreenEvent")
if (msg.isListItemFocused())
print "Title name = ";menuJson.categories[msg.GetIndex()].Title
print "Title id isListItemFocused = ";menuJson.categories[msg.GetIndex()].id
else if (msg.isListItemSelected())
if menuJson.categories[msg.GetIndex()].type = "category"
appMenuScreen(menuJson.categories[msg.GetIndex()].id, menuJson.categories[msg.GetIndex()].Title)
else
displayVideo(menuJson.categories[msg.GetIndex()].id)
endif
'ShowMessageDialog()
endif
endif

end while
End Function

1 Reply

  • have you figured this out? I am having the same issue..