Posts: 17,414
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,414
I have a fixedlist with a movement value of 1, a focus position of 2 and the whole list is 3 rows. It's filled with static content but always start control on the 2nd item instead of the first completing ignoring <defaultcontrol>1</defaultcontrol> when the first item is id="1".
If however I use <defaultcontrol always="true">1</defaultcontrol> it will gain control on the first item but this then breaks regaining control at the last item selected.
Thanks.
Posts: 4,146
Joined: Jan 2008
Reputation:
40
Mind sharing a dummy window to make it easier for us?
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.
Posts: 5,184
Joined: Jan 2009
Reputation:
131
I vaguely remember reading over the <defaultcontrol> handling code when I was debugging an issue that appeared after my settings dialog refactor and I was wondering if it always worked correctly. Seems like it really doesn't. I'll try to find the time to look into it. Do you happen to have a simple diff or modified XML for confluence so I can easily test this?
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.
Posts: 5,184
Joined: Jan 2009
Reputation:
131
Reading the code (don't have a build environment here) it looks like the problem is that the static list provider (CStaticListProvider) interprets the default item value as an index and not as a control ID. Therefore setting <defaultcontrol> to 1 will lead to the second item being selected (as the indexing starts with 0). Not sure though why it would work when you set it to always focus the default control.
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not e-mail Team Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.
Posts: 17,414
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,414
I thought it might have been using index instead of the actual control ID but even using 0 has no effect. If I remove the movement tag it will focus on the first item whether I use default control or not, and actually trying to set it to another value other than 0 has no affect whatsoever.
I have found that if you use always="true" then you must use IDs for the items otherwise that doesn't work either.
I'll knock up some test code for Confluence later.
Thanks.
Posts: 17,414
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,414
2015-01-05, 21:09
(This post was last modified: 2015-01-05, 21:09 by Hitcher.)
Actually it's easy to reproduce just by using Confluence's home menu.
Simply add <defaultcontrol>0</defaultcontrol> around line 830 and refresh the skin - no matter what value you use it always defaults to the 2nd item.
Then change it to <defaultcontrol always="true">nn</defaultcontrol> (where nn is a number of an item in the content) and it will work.
Thanks.
Posts: 4,146
Joined: Jan 2008
Reputation:
40
Kinda works for me when focusposition is removed. TBH, i have no idea how it should behave.
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.
Posts: 17,414
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,414
2015-01-06, 10:50
(This post was last modified: 2015-01-06, 10:51 by Hitcher.)
The first time it's used it should behave the same as always="true" and focus on the default value, which is generally the first item in the list. This behaviour can be seen in a non-static list by looking at Confluence's Poster Wrap view where the first item is focused when you first load that window.
Thanks.
Posts: 4,146
Joined: Jan 2008
Reputation:
40
2015-01-06, 11:24
(This post was last modified: 2015-01-06, 11:29 by mkortstiege.)
You're sure it has nothing to do with <focusedposition> being overridden when using 'always' within the <defaultcontrol> option?
EDIT: Just noticed that in Confluence <defaultcontrol>11</defaultcontrol> works just fine.. it will focus on tvshows.
Always read the
online manual (wiki),
FAQ (wiki) and search the forum before posting.
Do not PM or e-mail Team-Kodi members directly asking for support. Read/follow the
forum rules (wiki).
Please read the pages on
troubleshooting (wiki) and
bug reporting (wiki) before reporting issues.
Posts: 17,414
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,414
2015-01-06, 12:12
(This post was last modified: 2015-01-06, 12:21 by Hitcher.)
I think it might possibly be because the items in my fixedlist aren't visible when the window loads due to visible conditions not being met immediately.
EDIT: OK so I decided to use SetFocus(id,position) so I can get focus on the first item but realised that only uses position and not item.
Is there any chance of getting a SetFocusItem control for static lists?
Thanks.
Posts: 17,414
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,414
Sorry by static list I meant one filled with predefined static content by the skin.
I would be setting focus on the fixedlist from another control by which time it's been filled.
Posts: 17,414
Joined: Aug 2007
Reputation:
590
Hitcher
Team-Kodi Member
Posts: 17,414
Probably because your visible conditions are pretty much instantly verified as true whereas mine are for content that has to be loaded from the library.