Solved Container.NumItems ignores hidden items
#1
Hi i'm again Smile

i want to use a container (panel) to count how many menu items are visible/hidden in the custom settings, so it's a static panel with 6 items see in the code block.
Container.Numitems also gives me 6, although a few items are hidden by the visible condition.
i think it shouldn't be.

PHP Code:
<control type="panel" id="310" description="to get the number of active menuitems">
            <
posx>0</posx>
            <
posy>0</posy>
            <
width>6</width>
            <
height>1</height>
            <
orientation>vertical</orientation>
            <
itemlayout height="1" width="1">
            </
itemlayout>
            <
focusedlayout height="1" width="1">
            </
focusedlayout>
            <
content>
                <
item id="1" description="Movies"><visible>!Skin.HasSetting(MoviesSectionHide)</visible></item>
                <
item id="2" description="TvShows"><visible>!Skin.HasSetting(TVSectionHide)</visible></item>
                <
item id="3" description="Music"><visible>!Skin.HasSetting(MusicSectionHide)</visible></item>
                <
item id="4" description="Pictures"><visible>!Skin.HasSetting(PicturesSectionHide)</visible></item>
                <
item id="5" description="Addons"><visible>!Skin.HasSetting(AddonsSectionHide)</visible></item>
                <
item id="6" description="XBMC"><visible>true</visible></item>
            </
content>
        </
control
Reply
#2
According to the code, it returns m_items.size() which is the number of visible items, as the container doesn't see the invisible items at all (they're held in a seperate list). So it shouldn't give you 6 at all?
Always read the XBMC online-manual, FAQ and search the forum before posting.
Do not e-mail XBMC-Team members directly asking for support. Read/follow the forum rules.
For troubleshooting and bug reporting please make sure you read this first.


Image
Reply
#3
i set one item <visible>false</visible> and it says 6 all time.
Reply
#4
Your items are not valid without adding <onclick>noop</onclick>. That's why it doesn't work.
Image
Reply

Logout Mark Read Team Forum Stats Members Help
Container.NumItems ignores hidden items0