Req Var.IsEmpty similar to String.IsEmpty
#1
Title explains everything. This will save a looooooot of lines.

Example of the current situation:
I have a variable called $VAR[sub_label] with 50< conditions.
If I want to move a label control a few pixels to the bottom within a list - because the sub_label variable is empty - I'll have to add all those conditions as visiblity condition too.

Edit:

Example use case

Code:

<variable name="example">
<value condition="String.IsEqual(ListItem.DBType,movie)">Another movie</value>
<value condition="String.IsEqual(ListItem.DBType,tvshow)">Another tvshow</value>
</variable>

Code:

<control type="list">
...
<itemlayout>
<control type="label">
<label>My Label</label>
<animation effect="slide" end="0,10" time="0" condition="Var.IsEmpty(example)">Conditional</animation>
</control>
<control type="label">
<top>20</top>
<label>$VAR[example]</label>
</control>
</itemlayout>

<focusedlayout>
<control type="label">
<label>My Label</label>
<animation effect="slide" end="0,10" time="0" condition="Var.IsEmpty(example)">Conditional</animation>
</control>
<control type="label">
<top>20</top>
<label>$VAR[example]</label>
</control>
</focusedlayout>

</control>
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#2
Have you tried using a label ID and then Control.GetLabel(ID) for the visibility condition:
Code:
<control type="label" id="9001">
    <label>$VAR[sub_label]</label>
</control>

<visible>String.IsEmpty(Control.GetLabel(9001))</visible>
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#3
I'm aware of those "skin hacks" Smile . Off course this works, but not for a list control where I need it for every single displayed item.

Edit:
I've adjusted my example above to get a better understanding of the problem.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#4
Ah, ok I see what you are trying to do now. I originally thought you were talking about a grouplist.

Definitely can see the use case for a normal list. Makes for much more straightforward and readable code too.

+1
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply

Logout Mark Read Team Forum Stats Members Help
Var.IsEmpty similar to String.IsEmpty0