fixedlist and Container.HasNext problem
#1
Hi, is there a limitation with Container.HasNext for fixedlists? I can't seem to get it to work properly.
I would like to add "indicator arrows" for a fixed list to show that there are elements outside the visible area.

Container.HasPrevious works just as expected but Container.HasNext does not. When approaching the end of the list, the indicator does disappear when you reach the "final page" (as it should) but as soon as you continue down the list to the last few items, the indicator with Container.HasNext reappears and stays on. The fixedlist has 5 visible items with focusposition set to 1.

I hope I have explained it properly, otherwise I'll post the code if need be..
Reply
#2
I guess I am the only one with this problem....

Can someone at least tell me a skin which has similar indicator arrows so that I may check the code? Can't find them in the ones I've tested...
Reply
#3
No sir, not alone - I'm trying to do the same thing (mostly with panels however).

A combination of Container(id).NumItems and Container(id).Position might be a way forward. If I can get this (or an alternative) to work, I will post the code.
Reply
#4
Cheers deadman, let me know if you come up with something. Unfortunately, Container.Position doesn't work with fixed lists as it always returns the focusposition value.

I think the container.hasnext problem is actually a bug, as per Jezz_x's post (http://forum.xbmc.org/showthread.php?tid=60163) the functionality should be pretty straight forward...
Reply
#5
!IsEmpty(Container(id).ListItemNoWrap(offset).Label) could work. Offset should be 4 if you have 5 items with focusposition 1.
Image
Reply
#6
That works, thanks Black Smile

Still think container.hasnext has a bug, though it's great there's a workaround. Good find!
Reply
#7
Thanks Black, Echo,

Trying to do something similar with grouplist controls (e.g. settingsCategory.xml). It seems Container(id).NumItems doesn't do much for grouplists - any ideas?
Reply
#8
Will need a (simple) code example to allow reproduction if there is a bug. Ideally a change in confluence (perhaps in home?)
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
#9
I don't think it can work that way....a grouplist isn't a Container as such (only list, wrap, fixed and panel are), so those "Container(id).NumItems" and similar don't work for them, only .HasFocus(id) is valid.
Reply
#10
Hi jmarshall, easily reproduced. Just add the following as the last controls on home under confluence:
Code:
            <control type="label">
                <posx>200</posx>
                <posy>350</posy>
                <width>250</width>
                <height>50</height>
                <font>font30</font>
                <textcolor>white</textcolor>
                <align>center</align>
                <aligny>center</aligny>
                <label>leftarrow</label>
                <visible>Container(9000).HasPrevious</visible>
            </control>
            <control type="label">
                <posx>700</posx>
                <posy>350</posy>
                <width>250</width>
                <height>50</height>
                <font>font30</font>
                <textcolor>white</textcolor>
                <align>center</align>
                <aligny>center</aligny>
                <label>rightarrow</label>
                <visible>Container(9000).HasNext</visible>
            </control>
and scroll the menu. When you reach Music coming from left, "rightarrow" disappears as it should, but then reappears when you're on Programs or System.
Reply
#11
(2013-12-10, 23:09)echo Wrote: I don't think it can work that way....a grouplist isn't a Container as such (only list, wrap, fixed and panel are), so those "Container(id).NumItems" and similar don't work for them, only .HasFocus(id) is valid.

Thanks Echo
Reply
#12
Thanks - fixed in b50a14dd2dc
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
#13
This is still (or again ?) broken in Custom_Windows. Control.Move(id,1) & Control.Move(id,-1) is working fine.
Tested on Windows with Gotham Beta 1 & 2 and the latest nightly XBMCSetup-20140324-8e391eb.
After some test's that i did, the last time that this was working (in Custom_Windows) is with Gotham Alpha 9.

Here is the code that i am using:

Container...
PHP Code:
<control type="list" id="4001">
    <
posx>0</posx>
    <
posy>0</posy>
    <
width>0</width>
    <
height>0</height>
    <
onleft>10001</onleft>
    <
onright condition="!Player.HasMedia">5</onright>
    <
onright condition="Player.HasMedia">PlayerControl(Stop)</onright>
    <
ondown>10001</ondown>
    <
onup>10001</onup>
    <
itemlayout/>
    <
focusedlayout/>
    <
content>
       <
item id="1">
       ....
       </
item>
    </
content>
</
contol


Controls...
PHP Code:
<control type="grouplist" id="10001">
    <
posx>35</posx>
    <
posy>590</posy>
    <
width>1210</width>
    <
align>left</align>
    <
orientation>horizontal</orientation>
    <
onleft>10001</onleft>
    <
onright>10001</onright>
    <
onup>4000</onup>
    <
ondown>4000</ondown>
    <
control type="button" id="200">
      <
width>140</width>
      <
height>40</height>
      <
texturefocus border="39,3,39,39">windows/help/next_fo.png</texturefocus>
      <
texturenofocus border="39,3,39,39">windows/help/next_nf.png</texturenofocus>
      <
align>left</align>
      <
aligny>top</aligny>
      <
font>FontSize_20</font>
      <
textwidth>310</textwidth>
      <
textoffsetx>40</textoffsetx>
      <
textoffsety>6</textoffsety>
      <
textcolor>99grey</textcolor>
      <
focusedcolor>white</focusedcolor>
      <
shadowcolor>99000000</shadowcolor>
      <
label>Next</label>
      <
onclick>Control.Move(4001,1)</onclick>
      <
visible>Container(4001).HasNext</visible>
  </
control>
  <
control type="button" id="201">
      <
width>140</width>
      <
height>40</height>
      <
texturefocus border="39,3,39,39">windows/help/previous_fo.png</texturefocus>
      <
texturenofocus border="39,3,39,39">windows/help/previous_nf.png</texturenofocus>
      <
align>left</align>
      <
aligny>top</aligny>
      <
font>FontSize_20</font>
      <
textwidth>310</textwidth>
      <
textoffsetx>40</textoffsetx>
      <
textoffsety>6</textoffsety>
      <
textcolor>99grey</textcolor>
      <
focusedcolor>white</focusedcolor>
      <
shadowcolor>99000000</shadowcolor>
      <
label>Previous</label>
      <
onclick>Control.Move(4001,-1)</onclick>
      <
visible>Container(4001).HasPrevious</visible>
    </
control>
</
control


Cheers
Nessus
Reply
#14
I'd like to bump this please. Still not working in Beta 3.

Is it possible someone to confirm if this stays as it is in Gotham so i can search for another workaround ?

Cheers
Nessus
Reply

Logout Mark Read Team Forum Stats Members Help
fixedlist and Container.HasNext problem0