Kodi Community Forum

Full Version: Group Lists and Conditional Visibility
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
I've been playing about with grouplists and trying to optimise some code. There were quite a few similar grouplists containing buttons which I am trying to combine using conditional visibility.

My problem now is that if any of the buttons are hidden then navigating through them doesn't work properly. I can scroll left no problem but if I scroll right it stops on the button before the hidden one.

An example is as follows:

Code:
<control type="grouplist">
  <include>mediamenugroup</include>

  <control type="button" id="2">
    <label>100</label>
    <include>mediamenu</include>
  </control>

  <control type="button" id="3">
    <label>103</label>
    <include>mediamenu</include>
  </control>

  <control type="button" id="5">
    <label>Library</label>
    <include>mediamenu</include>
    <onclick>Skin.SetBool(movielibrary)</onclick>
    <onclick>XBMC.ReplaceWindow(MyVideoLibrary,movietitles)</onclick>
    <visible>Skin.HasSetting(videomovies)</visible>
  </control>
  <control type="button" id="5">
    <label>Library</label>
    <include>mediamenu</include>
    <onclick>Skin.SetBool(tvlibrary)</onclick>
    <onclick>XBMC.ReplaceWindow(MyVideoLibrary,tvshowtitles)</onclick>
    <visible>Skin.HasSetting(videotv)</visible>
  </control>

  <control type="button" id="20">
    <label>Setup</label>
    <include>mediamenu</include>
    <onclick>XBMC.ActivateWindow(myvideossettings)</onclick>
  </control>

</control>

Now if I'm looking at clips the two buttons with id=5 are hidden but it doesn't scroll through them left and right, only to the left.

Am I using them incorrectly or is this a bug?
It's likely due to the fact they have the same id. Thus, the onright points to itself.

Change the id of the second button perhaps?
You're a genius!

It's so simple as well, why didn't I think of that?!

Thanks Nod