problem with conditional Include (and propeties)
#1
shuldnt this work?

PHP Code:
<?xml version="1.0" encoding="UTF-8"?>
<includes>

    <!-- Default File List -->
    <include name="Viewtype50">
    
        <include condition="IsEmpty(Window.Property(SpezList))">DefaultFileList</include>    
        <include condition="!IsEmpty(Window.Property(SpezList))">SpecialFileList</include>
        
    </include>

</includes> 

---

i try to show a different list depending on a condition, nothing i did try work.

1st try -> see aboth

2nd try:

use 2 different Views (ID="50" default - ID="53" special) and work with visibles:

PHP Code:
<!-- List -->
    <
control type="list" id="53">
        <
left>870</left>
        <
top>184</top>
        <
width>1050</width>
        <
height>720</height>
        <
onup>53</onup>
        <
ondown>53</ondown>
        <
onleft>close</onleft>
        <
onright>63</onright>
        <
pagecontrol>63</pagecontrol>
        <
orientation>vertical</orientation>
        <
viewtype label="$LOCALIZE[535] (Spez)">list</viewtype>
        <
scrolltime tween="sine" easing="out">240</scrolltime>
        <
visible>!IsEmpty(Window.Property(SpezList))</visible>     <!-- <- doesnt Work! (-> the view wont show up) -->

        <
itemlayout height="76" width="1050">
                ....
        </
itemlayout

shouldnt this work?

EDIT: to be shure Kodi goes always to List id="53" (if visible), i did also use "<defaultcontrol always="true">53</defaultcontrol>" which also doesnt seems to work! -> (it alway uses the last choosen view) /EDIT

---

i set the property by "oncklick" and "onload" (propetry seems to be set, as i can show it as a label)

onklick:
PHP Code:
<control type="button" id="8101">
                <
width>970</width>
                <
height>42</height>
                <
font>Font33</font>
                <
label>31163</label>
                <
textcolor>DialogTextColor2</textcolor>
                <
focusedcolor>DialogTextColor1</focusedcolor>
                <
invalidcolor>TextColor4</invalidcolor>
                <
disabledcolor>TextColor4</disabledcolor>
                <
onright>SetProperty(SpezList,true)</onright>
                <
onclick>SetProperty(SpezList,true,video)</onclick>
                <
onright>ActivateWindow(Videos,sources://video/)</onright>
                
<onclick>ActivateWindow(Videos,sources://video/)</onclick>
            
</control

onload (myvideoNav.xml)
PHP Code:
<onload condition="Window.Previous(settings)">SetProperty(SpezList,true)</onload>
    <
onunload>ClearProperty(SpezList)</onunload

-

out of ideas how else i can achieve what im after
(+ also not shure why the stuff i already try doesnt work Undecided)


what do i try to achive?:

A File-List(-style) / or View, which should only show up if the property (or an other matching given condition) is true..

i can easily show other elements (labels, images, dummylists, ..) in a View depending on the property via "<visible>" but as soon as i like to have a different list (fixedlist / list), nothing i try works..
Reply
#2
If you dont specify a window in which you set the property it gets set on the active window. I am guessing here that you have the button in home, so the property is Window(home).Property(SpezList).
But you check on Window(videos).Property(SpezList).
Reply
#3
(2016-05-31, 18:47)BigNoid Wrote: If you dont specify a window in which you set the property it gets set on the active window. I am guessing here that you have the button in home, so the property is Window(home).Property(SpezList).
But you check on Window(videos).Property(SpezList).
Thanks

did have something similar in minde, so i did try to set the propety like this:
PHP Code:
<onclick>SetProperty(SpezList,true,video)</onclick

and "cal" it via:
PHP Code:
<visible>!IsEmpty(Window(video).Property(SpezList))</visible
which didnt help

i also try to set it for "Home" which didnt help to.

as i can show the property as a label in the ListView (Id="53") via:
PHP Code:
<!-- Testlabel -->
<
control type="label">
    <
width>970</width>
    <
height>142</height>
    <
font>Font33</font>
    <
label>$INFO[Window.Property(SpezList)]</label>
    <
textcolor>DialogTextColor2</textcolor>
</
control

i guess the property is set correctly (just guessing)

EDIT:
my guess was that this isnt possible:
PHP Code:
<control type="list" id="53">
        ....
        <
visible>!IsEmpty(Window.Property(SpezList))</visible>     <!-- <- doesnt Work! (-> the view wont show up) --> 
-> shuld it work?
/EDIT

(2016-05-31, 18:47)BigNoid Wrote: I am guessing here that you have the button in home, so the property is Window(home).Property(SpezList).

the propety is set twice, once in settings.xml (onklick) and once by "onload" in myvideoNav.xml.
first i have it just as onload in MyVideoNav.xml (which did work for just showing a image right in myVideoNav.xml) but not for the List(View) -> Example aboth

first i thouth the property was set to solw, and so i set it also right away in the button (setting.xml) via "oncklick" which didnt help.
Reply
#4
Right, if you can see the label the property is correctly set. Having it in the onload of MyVideoNav won't work indeed as the views get checked before the property is set (after a skin.reload() it does work). But I just tried setting the property in another window and than it works when entering the video window. The video alias for videos will be removed shortly btw, so better use the latter.
Reply
#5
Thanks

a bunch

by chanching everything to "Home"

PHP Code:
<visible>!IsEmpty(Window(Home).Property(SpezList))</visible

things start to work!

looks like "video" isnt a valid window to assign a propety to /?/


Thanks
Reply
#6
Code:
videolibrary / videos

http://kodi.wiki/view/Window_IDs
Reply
#7
(2016-05-31, 23:16)Hitcher Wrote:
Code:
videolibrary / videos

http://kodi.wiki/view/Window_IDs

jer, looks like you cant use everiting from this list (at least "video" (7th item) didnt work for me), maby i use accidently right the only one wich didnt work /?/

As "video" will be removed for 17 (as BigNoid said) not realy a big deal i guess.

Im Happy that it now work as far as tested.. (use "Home" now, without nothicing any problems).

regards & Tanks

(EDIT: guess the case that it didnt work could be beacause it is only a "wrapper". (just a guess) /EDIT)
Reply

Logout Mark Read Team Forum Stats Members Help
problem with conditional Include (and propeties)1