Hi again,
Can anyone explain why the itemContentChanged gets called two times for the same item ?
I'm sure that the items are created only once, but somehow this methods gets triggered two times .
Here is a sample output from debugger. I don't think this is the normal behavior.
BrightScript Debugger>
Current Function:
021: function itemContentChanged() as void
022: m.itemData = m.top.itemContent.data
023:
024:* stop
025: if m.itemData.count() > 0
026: if m.itemData.contentType <> m.sgConstants.MENU_ROW_TILE_CONTENT_TYPE
027: if m.itemData.contentType = m.sgConstants.GO_TO_PROGRAM_TILE_CONTENT_TYPE
028: setGoToProgramTileAttributes()
STOP (runtime error &hf7) in pkg:/components/RowList/RowListItem.brs(24)
024: stop
Backtrace:
#0 Function itemcontentchanged() As Void
file/line: pkg:/components/RowList/RowListItem.brs(25)
Local Variables:
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=3 count:16
BrightScript Debugger> ? m.itemData
<Component: roAssociativeArray> =
{
contenttype: menu
id: browse
text: Shows
}
BrightScript Debugger> c
Current Function:
021: function itemContentChanged() as void
022: m.itemData = m.top.itemContent.data
023:
024:* stop
025: if m.itemData.count() > 0
026: if m.itemData.contentType <> m.sgConstants.MENU_ROW_TILE_CONTENT_TYPE
027: if m.itemData.contentType = m.sgConstants.GO_TO_PROGRAM_TILE_CONTENT_TYPE
028: setGoToProgramTileAttributes()
STOP (runtime error &hf7) in pkg:/components/RowList/RowListItem.brs(24)
024: stop
Backtrace:
#0 Function itemcontentchanged() As Void
file/line: pkg:/components/RowList/RowListItem.brs(25)
Local Variables:
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=3 count:16
BrightScript Debugger> ? m.itemData
<Component: roAssociativeArray> =
{
contenttype: menu
id: browse
text: Shows
}
BrightScript Debugger>
Debugging the SimpleRowList example shows exactly the same problem.Here is the output for the SimpleRowList example
Current Function:
013: function itemContentChanged() as void
014:* stop
015: itemData = m.top.itemContent
016: m.itemImage.uri = itemData.posterUrl
017: m.itemText.text = itemData.labelText
018: end function
STOP (runtime error &hf7) in pkg:/components/SimpleRowListItem.xml(14)
014: stop
Backtrace:
#0 Function itemcontentchanged() As Void
file/line: pkg:/components/SimpleRowListItem.xml(15)
Local Variables:
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=3 count:4
itemdata <uninitialized>
BrightScript Debugger> s
015: itemData = m.top.itemContent
BrightScript Debugger> ? itemData
<Component: roSGNode> =
{
metadata: <Component: roContentMetadata>
change: <Component: roAssociativeArray>
focusable: false
focusedChild: <Component: roInvalid>
id:
labelText: This is item 1
posterUrl: http://rokudev.roku.com/rokudev/samples/images/Landscape_1.jpg
}
BrightScript Debugger> c
Inside init
Leaving init
Current Function:
013: function itemContentChanged() as void
014:* stop
015: itemData = m.top.itemContent
016: m.itemImage.uri = itemData.posterUrl
017: m.itemText.text = itemData.labelText
018: end function
STOP (runtime error &hf7) in pkg:/components/SimpleRowListItem.xml(14)
014: stop
Backtrace:
#0 Function itemcontentchanged() As Void
file/line: pkg:/components/SimpleRowListItem.xml(15)
Local Variables:
global rotINTERFACE:ifGlobal
m roAssociativeArray refcnt=3 count:4
itemdata <uninitialized>
BrightScript Debugger> s
015: itemData = m.top.itemContent
BrightScript Debugger> ? itemData
<Component: roSGNode> =
{
metadata: <Component: roContentMetadata>
change: <Component: roAssociativeArray>
focusable: false
focusedChild: <Component: roInvalid>
id:
labelText: This is item 1
posterUrl: http://rokudev.roku.com/rokudev/samples/images/Landscape_1.jpg
}
BrightScript Debugger>