Surfacing info from container X within the <focuslayout> of container Y
#1
Hi, happy lockdown to those of you who are locked down. Hopefully this gives me the time to finally finish my skin Smile Or at least run into more issues I can't solve by myself... ahem...

So my latest issue - When container = Sets, I have the following info line - "2003 - 2008 / 3 Movies" - I did it based on previous advice and other skins I saw, where you have a hidden list to populate the contents of the set that is currently the ListItem like so:


xml:

<!--Hidden Set list-->
<control type="list" id="4500">
    <width>0</width>
    <height>0</height>
    <orientation>vertical</orientation>
    <itemlayout />
    <focusedlayout />
    <content sortby="year" sortorder="ascending">$INFO[ListItem.FolderPath]</content>
</control>

Then my label is this:

xml:
[UPPERCASE]$INFO[Container(4500).ListItem(0).Year]$INFO[Container(4500).ListItem(-1).Year,-]$INFO[Container(4500).NumItems, / , Movies][/UPPERCASE]

I don't know if this is still the recommended way, but I'm trying to avoid relying on addons that might slow things down.

It works great on most of my views, as this label would appear outside of the <focuslayout /> and <itemlayout /> tags. But on my Panel view, I want the label to be part of the <focuslayout> so that I don't have to worry about animating it's movement to match the container.

I understand this doesn't work, to reference a different container (X) within another. It appears to ignore the stated id of the container and fill it using the current container's information instead. I've been trying to figure out if there's a way around this using a window property or something else. I tried passing the above string to a window property as the <onfocus> action of a button embeded in my <focuslayout> thinking it would trigger every time the ListItem changes, but it doesn't seem to work:

xml:
            
<control type="button">
     <onfocus>SetProperty(SetInfo,[UPPERCASE]$INFO[Container(4500).ListItem(0).Year]$INFO[Container(4500).ListItem(-1).Year,-]$INFO[Container(4500).NumItems, / , Movies][/UPPERCASE],Home)</onfocus>
</control>

Then for my label:

xml:
$INFO[window(Home).property(SetInfo)]

In the screenshot below, the info at the top of the page is what should be showing under MCU, but it appears to be showing the info for Kill Bill instead:

Image
Reply
#2
Because your button is inside the focusedlayout it is just setting whatever the label is that you would get in the focusedlayout to the window property. Even if you could somehow get a button to set the property from outside, it would still be buggy because sometimes the container wouldn't have had time to update before you set the property (the $INFO is converted into a literal string at the moment the property is set - it doesn't retain the reference to the info).

I'm not sure if it is possible to do what you want to do (at least not without something very convoluted).
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
(2020-03-31, 13:01)jurialmunkey Wrote: Because your button is inside the focusedlayout it is just setting whatever the label is that you would get in the focusedlayout to the window property. Even if you could somehow get a button to set the property from outside, it would still be buggy because sometimes the container wouldn't have had time to update before you set the property (the $INFO is converted into a literal string at the moment the property is set - it doesn't retain the reference to the info).

I'm not sure if it is possible to do what you want to do (at least not without something very convoluted).

Thanks I feared this might be the case, I'll try to see if I can replicate the movement of the label through the various scrolling positions with animations instead then it can exist outside of the focusedlayout.
Reply

Logout Mark Read Team Forum Stats Members Help
Surfacing info from container X within the <focuslayout> of container Y0