Button not willing to accept some $INFO in label
#1
I have the below button in my <control type="list"> <itemlayout>. Label is not displayed.
If I change its control type to "label" - labels are displayed. If I change $INFO to $INFO[Weather.Temperature], it is displayed.
The <content> for this list is videodb:// (or musicdb://).

Why such behaviour (and, in the first place, how to avoid it)?

Code:
<control type="button">
<description>List item label</description>
<top>0</top>
<left>BaseItemSize</left>
<height>BaseItemSize</height>
<width>LabelWidth</width>
<label>$INFO[ListItem.Label]</label>
<onclick>ActivateWindow($VAR[current_window],$INFO[ListItem.FolderPath])</onclick>
<texturefocus>-</texturefocus>
<texturenofocus>-</texturenofocus>
</control>
Reply
#2
Try adding container. So what ever you list Id is $INFO[Container (Id).Listitem.Label] ... Worth a try at least..
Shield TV | Windows 10 | Mariadb | Mii Box
Evolve Ecosystem Repo | TV Melodies | Madnox Holiday Mod
Reply
#3
Buttons shouldn't be used in list/panel controls (you will get unsupported control type errors in your log), and there is absolutely no reason to use one in <itemlayout> as it is not the focused item so the onclick etc does nothing. You can use them in <focusedlayout> as a hack to have an onfocus condition when moving through the list, but that is pretty much the only real use case.

You can change onclick for a list by putting the onclick in the definition part of the list control.
e.g.
Code:
<control type="list">
      <onclick condition="CONDITION">ACTION</onclick>
      <itemlayout>...</itemlayout>
      <focusedlayout>...</focusedlayout>
</control>

Also, I don't really understand what the point of that onclick action is, as a click on a folder in video/music will open the folder automatically.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#4
1. I am not in context of MyMusicNav or MyVideoNav. I am in context of custom dialog called directly from Home screen. Neither MyMusicNav nor MyVideoNav has been called yet.

2. There is no word in documentation about using List only for non-interactive content.

3. Used button in <itemlayout> on the presumption, that using label in <itemlayout> and button in <focusedlayout> would cause creating unneeded extra controls and redraw problems when refreshing control (another problem I am experiencing). In other way, I assumed both layouts would use the same control.

3. onclick for list is not included in the documentation, so I have not tried it, but it doesn't work anyway:

<onclick>ActivateWindow(video,$INFO[ListItem.FolderPath])</onclick>

if the list's <content> is videodb://

And the purpose is to open fe. MyVideoNav with already limited content.
Reply
#5
You shouldn't need a button to open the contents from videodb://.
Reply
#6
You probably are not specifying the target of the dynamic content
e.g.
Code:
<content target="videos">videodb://movies/sets</content>

http://kodi.wiki/view/Dynamic_List_Content
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#7
This doesn't work. Click does nothing (however click sound can be heard). Just to be precise, the <content> is videodb://.
I also removed onclick action.

This is the list - $INFO[Window(home).Property(libNode)] is replaced by videodb://, musicdb:// or something for images I don't know yet.

Code:
<control type="list">
    <description>List with items</description>
    <viewtype>list</viewtype>
    <top>BaseItemSize</top>
    <left>0</left>
    <width>ListWidth</width>
    <height>ListHeight</height>
    <orientation>vertical</orientation>
    <pagecontrol>101</pagecontrol>
    <content target="videos">$INFO[Window(home).Property(libNode)]</content>
    <focusedlayout width="ItemWidth" height="BaseItemSize">
        <control type="image">
            <description>List item background</description>
            <width>ListWidth</width>
            <height>BaseItemSize</height>
            <texture>textures\lightbg.png</texture>
        </control>
        <control type="image">
            <description>List item icon</description>
            <width>BaseItemSize</width>
            <height>BaseItemSize</height>
            <info>ListItem.Icon</info>
        </control>
        <control type="label">
            <description>List item label</description>
            <top>0</top>
            <left>BaseItemSize</left>
            <height>BaseItemSize</height>
            <width>ItemWidth</width>
            <info>ListItem.Label</info>
        </control>
    </focusedlayout>
    <itemlayout width="ItemWidth" height="BaseItemSize">
        <control type="image">
            <description>List item background</description>
            <width>ListWidth</width>
            <height>BaseItemSize</height>
            <texture>textures\lightbg.png</texture>
        </control>
        <control type="image">
            <description>List item icon</description>
            <width>BaseItemSize</width>
            <height>BaseItemSize</height>
            <info>ListItem.Icon</info>
        </control>
        <control type="label">
            <description>List item label</description>
            <top>0</top>
            <left>BaseItemSize</left>
            <height>BaseItemSize</height>
            <width>ItemWidth</width>
            <info>ListItem.Label</info>
        </control>
    </itemlayout>
</control>
Reply
#8
What's the videodb:// path that you tried?
Also, why doesn't your list control have an id?
How are you even focussing it, if it doesn't have an id?
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#9
The path is exactly "videodb://" and looking at the result, it is the right one.
Somewhere I read that id is not always required - just when needed.
For now I use it with mouse - no problems.
Reply
#10
Your code works perfectly fine for me using videodb:// as the content path.

Have you actually finished MyVideoNav? And are you sure MyVideoNav works fine?
i.e. Can you call MyVideoNav and have it open by using:
Code:
ActivateWindow(Videos,videodb://movies/titles/)

Because it sounds like you might have a bug in MyVideoNav that is preventing it from being opened.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#11
kodi.log will help a little.
Also notepad++ with the XML plugin is good for a quick check of code..
Reply
#12
MyVideoNav works OK called with ActivateWindow(Videos,videodb://movies/titles/) (it's actuallyuntouched Estuary file at this moment).

I am working with Microsoft XML Notepad, so my XML is well-formed (should DTD be available, I could also test for validity).

But I think kodi.log may be on on something (so far it was good for nothing for me):
00:56:54.536 T:4444 DEBUG: Activating window ID: 10025
00:56:54.536 T:4444 INFO: Activate of window '10025' refused because there are active modal dialogs
10025 is MyVideoNav, but Estuary file has no window ID defined in MyVideoNav

Still, how it could work for jurialmunkey thenHuh

BTW, here http://forum.kodi.tv/showthread.php?tid=310511 I raised related question - it seems dialog should be closed before opening window - but adding <onclick> to list overrides list items' onclick actions...
Reply
#13
Because I tried it from Home.xml not a dialog. Dialogs need to be closed before opening another window. If you need to create a dialog type effect that has library or plugin content in it, you are better off faking it by making an include and including it any window you need it and using a visibility condition to show/hide it rather than making a custom window dialog.
Arctic Fuse - Alpha now available. Support me on Ko-fi.
Reply
#14
Thanks, works at last!

Just an issue - when I am returning from fe. MyVideoNav, my dialog is still visible. I control its visibility with a Property. There is no way I know of to unset the property when clicking an item on the list.
Can you suggest some elegant way to solve this issue? I could unset the Property on each window on loading, but I don't think it's nice.
Reply
#15
Use onunload from the home window.
Reply

Logout Mark Read Team Forum Stats Members Help
Button not willing to accept some $INFO in label0