Roku Developer Program

Join our online forum to talk to Roku developers and fellow channel creators. Ask questions, share tips with the community, and find helpful resources.
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jaxim
Visitor

ZoomRowList rowDecorationComponentName property not being able to be set??

I am not able to successfully set the rowDecorationComponentName of the new ZoomRowList. According to the following documentation page on ZoomRowList, the property should be a string of the component name.
https://sdkdocs.roku.com/display/sdkdoc/ZoomRowList#ZoomRowList-ZoomRowListFields

But I get the following error:
=================================================================
Warnings occurred while creating XML component [name of component]
-- Type mismatch occurred when setting the "rowDecorationComponentName" field of a "ZoomRowList" node
   at line 99 of file pkg:[path and name of component file].xml
=================================================================

If I set the rowDecorationComponentName property to an array like the following, this warning does not happen. However, the init() function of the rowDecoration component does not get called.

rowDecorationComponentName='["TestTitle"]'

Is there a way to resolve this? Or is the zoomRowList not quite ready for primetime?
0 Kudos
13 REPLIES 13
speechles
Roku Guru

Re: ZoomRowList rowDecorationComponentName property not being able to be set??

how are you init the zoomrowlist? What is the node in your zoomrowlist.xml?

m.zoomrow = m.top.findnode("idZoomRowList")
m.zoomrow.observefield("RowItemFocused","ChangedRowItemFocus")

The init gets called once. Not every time the component is created. It gets called once at main init. So you set your variables to starting values in this section. Not make dynamic changes. Everything in init is static.

Can you show some of the code and what you are trying to do? Do you have an .xml and .brs for the zoomrowlist? It is hard to see what you are attempting to do.
0 Kudos
jaxim
Visitor

Re: ZoomRowList rowDecorationComponentName property not being able to be set??

I am instantiating the zoomRowList within the XML.
 
<ZoomRowList
     id="RowList"
     rowDecorationComponentName='["CategoryGridRowLabel"]'
     ...
I've also tried:
<ZoomRowList
     id="RowList"
     rowDecorationComponentName="CategoryGridRowLabel"
     ...
 
The code is very simple. I would recommend you try implementing ZoomRowList and see if you can get the rowDecorationComponentName to work.
 
But because ZoomRowList is new, I suspect it has a lot of bugs and is probably not ready for primetime
0 Kudos
destruk
Streaming Star

Re: ZoomRowList rowDecorationComponentName property not being able to be set??

What is your xml for the row decoration component you are trying to use?  If there is a problem there then that won't compile, which will cause it to fail when you try to set the rowdecoration to an errored component name. I can tell you now that this is incorrect rowDecorationComponentName='["CategoryGridRowLabel"]'
It ought to be rowDecorationComponentName="CategoryGridRowLabel"
If your custom decoration component is named CategoryGridRowLabel
0 Kudos
speechles
Roku Guru

Re: ZoomRowList rowDecorationComponentName property not being able to be set??

yeah.. lol.. I was going to ask WTF this was..

rowDecorationComponentName='["TestTitle"]'

Since when does brightscript or XML want those single quotes? Since the 10th of Never.. lol. I think alot of the issues here are probably semantics and syntax issues. If you give us actual code you have we can help you. We wont steal it. Believe me. We have no reason to... lol. Believe me...
0 Kudos
jaxim
Visitor

Re: ZoomRowList rowDecorationComponentName property not being able to be set??

I agree. It should be:
rowDecorationComponentName="CategoryGridRowLabel"



But that causes the mismatch warning that I stated in my original post. Through testing, I have found that setting the value to an array does not cause that warning to appear. This is NOT what the documentation recommends to do, so I agree that in normal cases, I should not do that.

Regardless, whether I set the value to a string or an array, the result is the same. The rowDecorationComponent does not instantiate. For example, I set a comment in the component's init() function and this comment does not show up in the console when I debug.
0 Kudos
destruk
Streaming Star

Re: ZoomRowList rowDecorationComponentName property not being able to be set??

And the problem there is probably with your decoration component that you haven't posted for anyone to look at.
If your CategoryGridRowLabel component doesn't exist, has an error, or another issue which prevents it from compiling then it would be classed as an invalid type, causing a type mismatch.  Simply assigning a value ( that is valid ) to a variable wouldn't cause a type mismatch so that doesn't prove or disprove anything.

I would guess the component itself would be similar to the one you might use for the custom row title component option which does work, and I tested that one.

Something like this?
RowTitleCustom.brs
'inits grid screen
'creates all children
'sets all observers

Function Init()
m.rowTitleCustom=m.top.findNode("RowTitleCustom")
m.top.observeField("content","onContentChange")
End Function

Sub OnContentChange()
m.top.getChild(0).Text=m.top.content.title

tempX=m.top.getChild(0).translation[0]
tempY=m.top.getChild(0).translation[1]

'Get size of item width and height
tempSizeRect=m.top.getChild(0).boundingRect()

'Determine proper center offset for item
updatedX=tempX+tempSizeRect.width+30

'Set new position of item #2 so it is properly placed using the original Y location
m.top.getChild(1).Translation=[updatedX,tempY]

m.top.getChild(1).Text="SPONSORED BY"

tempX=m.top.getChild(1).translation[0]
'Get size of item width and height
tempSizeRect=m.top.getChild(1).boundingRect()

'Determine proper center offset for item
updatedX=tempX+tempSizeRect.width+30

'Set new position of item #2 so it is properly placed using the original Y location
m.top.getChild(2).Translation=[updatedX,tempY]

m.top.getChild(2).URI="pkg:/images/PHUT.png"
End Sub



RowTitleCustom.xml
<?xml version="1.0" encoding="utf-8" ?>

<component name="RowTitleCustom" extends="Group" >
<!-- main handler -->
<interface>
<field id="content" type="node" onChange="onContentChange" />
</interface>
<script type="text/brightscript" uri="pkg:/components/screens/GridScreen/RowTitleCustom.brs" />

<children>
<Label
id="Title"
color="0xF0F0F0"
text=""
/>

<Label
id="Sponsored"
color="0xF0F0F0"
wrap="FALSE"
width="300"
height="0"
lineSpacing="3"
translation="[190,0]" />

<Poster
id="Image"
width="210"
height="30"
translation="[417,0]"/>

</children>
</component>



The image is a small pizza hut logo.
0 Kudos
jaxim
Visitor

Re: ZoomRowList rowDecorationComponentName property not being able to be set??

For testing purposes, my component was even simpler than that. The XML has no children and the BRS just has an init() function. The mismatch warning still appears.

CategoryGridRowLabel.xml

<?xml version="1.0" encoding="utf-8" ?>

<component name="CategoryGridRowLabel" extends="Group" >
 <interface>
 </interface>
 <script type="text/brightscript" uri="pkg:/components/screens/CategoryGridRowLabel.brs" />
 
 <children>
 </children>
</component>



CategoryGridRowLabel.brs

Function Init()
'//This never gets displayed in the terminal
 ?"CategoryGridRowLabel, init()!!!!!!!!!!!!!!!!!!!!!!!!"
End Function



0 Kudos
destruk
Streaming Star

Re: ZoomRowList rowDecorationComponentName property not being able to be set??

You are correct - it's set in the firmware as a non-resizable array with a maximum size of 0. Also it doesn't appear to display the thumbnails - at least for me HDPosterUrl and SDPosterURL don't appear with zoomRowList - "[sg.itemscrollerbase.create.fail] Failed to create markup item" - So while you can use it, it doesn't appear to be fully functional. In order to use rowDecorationComponentName it needs to be a string value, not an array, in the firmware.
0 Kudos
jaxim
Visitor

Re: ZoomRowList rowDecorationComponentName property not being able to be set??

I'm able to display thumbnails by setting the itemComponentName. 
But it appears there are a few things about ZoomRowList that make it not ready for primetime. 
0 Kudos
Need Assistance?
Welcome to the Roku Community! Feel free to search our Community for answers or post your question to get help.

Become a Roku Streaming Expert!

Share your expertise, help fellow streamers, and unlock exclusive rewards as part of the Roku Community. Learn more.