I do something similar in AZ2 and Aura to create an auto-width list. You have to have a fixed number of items on screen.
In your grouplist items set the label using:
Code:
$INFO[Container(ID).ListItemPosition(POSITION).Label]
Replace ID with the id of your hidden list container.
Replace POSITION with the position of the item in the list.
So if you have three items on screen it will be something like
xml:
<control type="grouplist">
<!-- Position 0 Focused -->
<control type="label">
<label>$INFO[Container(ID).ListItemPosition(0).Label]<label>
<width>auto</width>
<visible>String.IsEqual(Container(ID).ListItemPosition(0).Label, Container(ID).ListItem.Label)</visible>
<visible>Integer.IsGreater(Container(ID).NumItems,0)</visible>
</control>
<!-- Position 0 Unfocused-->
<control type="label">
<label>$INFO[Container(ID).ListItemPosition(0).Label]<label>
<width>auto</width>
<visible>!String.IsEqual(Container(ID).ListItemPosition(0).Label, Container(ID).ListItem.Label)</visible>
<visible>Integer.IsGreater(Container(ID).NumItems,0)</visible>
</control>
<!-- Position 1 Focused -->
<control type="label">
<label>$INFO[Container(ID).ListItemPosition(1).Label]<label>
<width>auto</width>
<visible>String.IsEqual(Container(ID).ListItemPosition(1).Label, Container(ID).ListItem.Label)</visible>
<visible>Integer.IsGreater(Container(ID).NumItems,1)</visible>
</control>
<!-- Position 1 Unfocused-->
<control type="label">
<label>$INFO[Container(ID).ListItemPosition(1).Label]<label>
<width>auto</width>
<visible>!String.IsEqual(Container(ID).ListItemPosition(1).Label, Container(ID).ListItem.Label)</visible>
<visible>Integer.IsGreater(Container(ID).NumItems,1)</visible>
</control>
<!-- Position 2 Focused -->
<control type="label">
<label>$INFO[Container(ID).ListItemPosition(2).Label]<label>
<width>auto</width>
<visible>String.IsEqual(Container(ID).ListItemPosition(2).Label, Container(ID).ListItem.Label)</visible>
<visible>Integer.IsGreater(Container(ID).NumItems,2)</visible>
</control>
<!-- Position 2 Unfocused-->
<control type="label">
<label>$INFO[Container(ID).ListItemPosition(2).Label]<label>
<width>auto</width>
<visible>!String.IsEqual(Container(ID).ListItemPosition(2).Label, Container(ID).ListItem.Label)</visible>
<visible>Integer.IsGreater(Container(ID).NumItems,2)</visible>
</control>
</control>
Now you need to set your hidden list to only have the same number of items as are visible in your grouplist.
You can do this by setting the itemlayout/fixedlayout width to the total list width divided by the number of items
e.g. for three items:
xml:
<control type="list">
<width>300</width>
<orientation>horizontal</orientation>
<itemlayout width="100" />
<focusedlayout width="100" />
<content>[...]</content>
</control>
Now when your list scrolls past the third item (or however many you've set it up for), the grouplist labels will also update because they are based upon the position of the item in the list. Put your actual visibility conditions for each item inside the <item> of the <content> tag.
You will probably also want some sort of animation when you get to the end/beginning.
You can do that by putting some animations in your grouplist (replace ID with id of hidden list).
xml:
<animation effect="slide" start="0" end="-120" condition="!Container(ID).OnScrollNext" reversible="false" time="200" tween="quadratic">Conditional</animation>
<animation effect="slide" start="0" end="120" condition="!Container(ID).OnScrollPrevious" reversible="false" time="200" tween="quadratic">Conditional</animation>
You can see how I create the auto-width menu in AZ2 here:
https://github.com/jurialmunkey/skin.arc...ml#L3-L149