2019-06-21, 23:11
Hello all,
I am having an issue with visibility conditions for a panel I am using as a widget in Amber for Leia. I understood that testing for numitems > 0 or that the panel isupdating would work, but it does not and I have not been able to figure out why. Below are exceprts from the code of the skin. For reference:
1. HomeShelf is the include that draws the widgets. This is used in Home.xml. I did not include that part of the code here.
2. ShelfList is the group of widgets (up to 2 in this example).
3. Each individual widget is in ShelfSubList.
Excerpts of the code:
My apologies for the long code snippet, I just wanted it to be complete enough to be followed.
My issue is that I had to add another visibility condition in ShelfSubList (line 127 in the code snippet)
I hope someone can assist me with this issue, and I can provide any additional information that might be required. Thanks in advance.
Regards,
Bart
I am having an issue with visibility conditions for a panel I am using as a widget in Amber for Leia. I understood that testing for numitems > 0 or that the panel isupdating would work, but it does not and I have not been able to figure out why. Below are exceprts from the code of the skin. For reference:
1. HomeShelf is the include that draws the widgets. This is used in Home.xml. I did not include that part of the code here.
2. ShelfList is the group of widgets (up to 2 in this example).
3. Each individual widget is in ShelfSubList.
Excerpts of the code:
xml:<include name="HomeShelf">
<param name="xoffset"/>
<param name="yoffset"/>
<param name="shelfwidth"/>
<definition>
<control type="group">
<include content="ShelfList">
<param name="menuvisibility">Container(300).HasFocus(4)</param>
<param name="shelfvisible">![Skin.HasSetting(Hide.Movies.Shelf) | Skin.HasSetting(Hide.RecentlyAdded)]</param>
<param name="selectionlistid">400</param>
<param name="selectionlistlabel1">$LOCALIZE[20386]</param>
<param name="selectionlistlabel2">$LOCALIZE[31071]</param>
<param name="selectionlistvisible1">!Skin.HasSetting(Hide.Movies.Shelf.RecentlyAdded)</param>
<param name="selectionlistvisible2">!Skin.HasSetting(Hide.Movies.Shelf.InProgress)</param>
<param name="listitemtype1">Shelf_Posters</param>
<param name="listitemtype2">Shelf_Posters</param>
<param name="listitemlabel1">MoviesLabel</param>
<param name="listitemlabel2">MoviesLabel</param>
<param name="listitemcontent1">special://skin/xsp/movies_recentlyadded.xsp</param>
<param name="listitemcontent2">special://skin/xsp/movies_inprogress.xsp</param>
</include>
</control>
</definition>
</include>
<include name="ShelfList">
<param name="menuvisibility"/>
<param name="shelfvisible"/>
<param name="shelfplex">false</param>
<param name="selectionlistid"/>
<param name="selectionlistlabel1"/>
<param name="selectionlistlabel2"/>
<param name="selectionlistvisible1">false</param>
<param name="selectionlistvisible2">false</param>
<param name="listitemtype1">Shelf_Posters</param>
<param name="listitemtype2">Shelf_Posters</param>
<param name="listitemtype3">Shelf_Posters</param>
<param name="listitemlabel1">MoviesLabel</param>
<param name="listitemlabel2">MoviesLabel</param>
<param name="listitemcontent1"/>
<param name="listitemcontent2"/>
<param name="listitemcontenttype1">Path</param>
<param name="listitemcontenttype2">Path</param>
<param name="listitemsortby1"/>
<param name="listitemsortby2"/>
<param name="listitemsortorder1">descending</param>
<param name="listitemsortorder2">descending</param>
<param name="listitemlimit1">$VAR[ShelfSize]</param>
<param name="listitemlimit2">$VAR[ShelfSize]</param>
<param name="listitemtarget1">video</param>
<param name="listitemtarget2">video</param>
<definition>
<control type="group">
<animation effect="slide" start="0,0" end="-430,0" time="0" delay="0" reversible="true" condition="!Skin.HasSetting(VerticalHome)">conditional</animation>
<animation effect="slide" start="0,0" end="0,-100" time="0" delay="0" reversible="true" condition="Skin.HasSetting(Shelf.DoubleHeight)">conditional</animation>
<left>430</left>
<top>283</top>
<height>700</height>
<visible>$PARAM[menuvisibility]</visible>
<visible>$PARAM[shelfvisible]</visible>
<control type="grouplist" id="$PARAM[selectionlistid]8">
<height>707</height>
<width>1920</width>
<orientation>vertical</orientation>
<onup>$PARAM[selectionlistid]8</onup>
<ondown>300</ondown>
<scrolltime>0</scrolltime>
<include content="ShelfSubList">
<param name="itemid">1</param>
<param name="listitemonup">$PARAM[selectionlistid]2</param>
<param name="listitemondown">$PARAM[selectionlistid]2</param>
<param name="selectionlistid">$PARAM[selectionlistid]</param>
<param name="selectionlistlabel">$PARAM[selectionlistlabel1]</param>
<param name="listitemtype">$PARAM[listitemtype1]</param>
<param name="listitemcontent">$PARAM[listitemcontent1]</param>
<param name="listitemcontenttype">$PARAM[listitemcontenttype1]</param>
<param name="listitemsortby">$PARAM[listitemsortby1]</param>
<param name="listitemsortorder">$PARAM[listitemsortorder1]</param>
<param name="listitemlimit">$PARAM[listitemlimit1]</param>
<param name="listitemtarget">$PARAM[listitemtarget1]</param>
<param name="listitemlabel">$PARAM[listitemlabel1]</param>
<param name="listitemvisible">$PARAM[selectionlistvisible1]</param>
</include>
<include content="ShelfSubList">
<param name="itemid">2</param>
<param name="listitemonup">$PARAM[selectionlistid]1</param>
<param name="listitemondown">$PARAM[selectionlistid]1</param>
<param name="selectionlistid">$PARAM[selectionlistid]</param>
<param name="selectionlistlabel">$PARAM[selectionlistlabel2]</param>
<param name="listitemtype">$PARAM[listitemtype2]</param>
<param name="listitemcontent">$PARAM[listitemcontent2]</param>
<param name="listitemcontenttype">$PARAM[listitemcontenttype2]</param>
<param name="listitemsortby">$PARAM[listitemsortby2]</param>
<param name="listitemsortorder">$PARAM[listitemsortorder2]</param>
<param name="listitemlimit">$PARAM[listitemlimit2]</param>
<param name="listitemtarget">$PARAM[listitemtarget2]</param>
<param name="listitemlabel">$PARAM[listitemlabel2]</param>
<param name="listitemvisible">$PARAM[selectionlistvisible2]</param>
</include>
</control>
</control>
</definition>
</include>
<include name="ShelfSubList">
<param name="itemid"/>
<param name="selectionlistid"/>
<param name="selectionlistlabel"/>
<param name="listitemtype"/>
<param name="listitemcontent"/>
<param name="listitemcontenttype"/>
<param name="listitemsortby"/>
<param name="listitemsortorder"/>
<param name="listitemlimit"/>
<param name="listitemtarget"/>
<param name="listiteminclude"/>
<param name="listitemlabel"/>
<param name="listitemvisible"/>
<param name="listitemonup"/>
<param name="listitemondown"/>
<param name="plex">false</param>
<definition>
<control type="group">
<visible>$PARAM[listitemvisible]</visible>
<visible>Integer.IsGreater(Container($PARAM[selectionlistid]$PARAM[itemid]).NumItems,0) | Container($PARAM[selectionlistid]$PARAM[itemid]).IsUpdating</visible>
<include condition="Skin.HasSetting(VerticalHome)">Vertical_SubShelf_Commons</include>
<include condition="!Skin.HasSetting(VerticalHome)">Horizontal_SubShelf_Commons</include>
<height>707</height>
<control type="image">
<width>1920</width>
<include condition="Skin.HasSetting(Shelf.DoubleHeight)">Double_SubShelf_BGHeight</include>
<include condition="!Skin.HasSetting(Shelf.DoubleHeight)">Single_SubShelf_BGHeight</include>
<texture border="0,40,0,00">home/ShelfBackground.png</texture>
</control>
<control type="label">
<visible>Control.HasFocus($PARAM[selectionlistid]$PARAM[itemid])</visible>
<top>-6</top>
<height>45</height>
<label>$INFO[Container($PARAM[selectionlistid]$PARAM[itemid].ListItem.Label,,]</label>
<font>Shelf_Title</font>
<textcolor>Highlight</textcolor>
<textoffsetx>16</textoffsetx>
<aligny>center</aligny>
</control>
<control type="label">
<visible>!Control.HasFocus($PARAM[selectionlistid]$PARAM[itemid]) + Skin.HasSetting(Show_Library_Count)</visible>
<top>-6</top>
<height>45</height>
<label>$VAR[LibraryStats]</label>
<textoffsetx>16</textoffsetx>
<font>Shelf_Title</font>
<aligny>center</aligny>
</control>
<control type="label">
<top>-6</top>
<height>45</height>
<label>$PARAM[selectionlistlabel]</label>
<font>Shelf_Title</font>
<textcolor>Highlight</textcolor>
<align>right</align>
<aligny>center</aligny>
</control>
<control type="panel" id="$PARAM[selectionlistid]$PARAM[itemid]">
<visible>$PARAM[listitemvisible]</visible>
<onup>$PARAM[listitemonup]</onup>
<onup>Control.Move($PARAM[selectionlistid]9,1)</onup>
<ondown condition="!Skin.HasSetting(VerticalHome)">300</ondown>
<ondown condition="Skin.HasSetting(VerticalHome)">$PARAM[listitemondown]</ondown>
<onright>$PARAM[selectionlistid]$PARAM[itemid]</onright>
<onback>300</onback>
<onleft condition="Skin.HasSetting(VerticalHome)">300</onleft>
<onleft condition="!Skin.HasSetting(VerticalHome)">$PARAM[selectionlistid]$PARAM[itemid]</onleft>
<left>32</left>
<top>53</top>
<include condition="Skin.HasSetting(Shelf.DoubleHeight)">Double_SubShelf_Height</include>
<include condition="!Skin.HasSetting(Shelf.DoubleHeight)">Single_SubShelf_Height</include>
<include condition="Skin.HasSetting(VerticalHome)">Vertical_SubShelf_Commons</include>
<include condition="!Skin.HasSetting(VerticalHome)">Horizontal_SubShelf_Commons</include>
<orientation>horizontal</orientation>
<include>VisibleFadeEffectDelayShelf</include>
<itemlayout height="315" width="228.5">
<include content="GenericPosterIconShelf">
<param name="isFocused">false</param>
</include>
</itemlayout>
<focusedlayout height="315" width="228.5">
<include content="GenericPosterIconShelf">
<param name="isFocused">Control.HasFocus($PARAM[selectionlistid]$PARAM[itemid])</param>
</include>
</focusedlayout>
<content sortby="$PARAM[listitemsortby]" sortorder="$PARAM[listitemsortorder]" limit="$PARAM[listitemlimit]" target="$PARAM[listitemtarget]">$PARAM[listitemcontent]</content>
</control>
</control>
</definition>
</include>
My apologies for the long code snippet, I just wanted it to be complete enough to be followed.
My issue is that I had to add another visibility condition in ShelfSubList (line 127 in the code snippet)
, because if I only had the visibility condition below thatxml:<visible>$PARAM[listitemvisible]</visible>
then the widgets would not be displayed at all.xml:<visible>Integer.IsGreater(Container($PARAM[selectionlistid]$PARAM[itemid]).NumItems,0) | Container($PARAM[selectionlistid]$PARAM[itemid]).IsUpdating</visible>
I hope someone can assist me with this issue, and I can provide any additional information that might be required. Thanks in advance.
Regards,
Bart