2015-09-15, 22:55
Hi,
I'm facing a weird behavior with my code. Because my viewtype is built on the fly (id, name, etc) in an include, the last focused position is lost when window is replaced or closed. Reopening it automatically goes to the first item.
I tried a workaround by setting the position in memory :
And force the position at window opening (MyXXXNav.xml) :
It works fine excepted when KODI has "Show parent folder item" unselected. Because there is no more "0" item. The focus position results in the last item selected + 1.
Since it's a panel container, using in complement a Control.Move($PARAM[Id],-1) is not correct since it shifts the selection to the upper row instead of the previous item.
If someone has an idea.
Thanks in advance
I'm facing a weird behavior with my code. Because my viewtype is built on the fly (id, name, etc) in an include, the last focused position is lost when window is replaced or closed. Reopening it automatically goes to the first item.
I tried a workaround by setting the position in memory :
Code:
SetProperty(ListPos,$INFO[Container($PARAM[Id]).CurrentItem],Home)
And force the position at window opening (MyXXXNav.xml) :
Code:
<onload condition="!IsEmpty(Window(Home).Property(ListPos))">Control.SetFocus($PARAM[Id],$INFO[Window(Home).Property(ListPos)])</onload>
It works fine excepted when KODI has "Show parent folder item" unselected. Because there is no more "0" item. The focus position results in the last item selected + 1.
Since it's a panel container, using in complement a Control.Move($PARAM[Id],-1) is not correct since it shifts the selection to the upper row instead of the previous item.
If someone has an idea.
Thanks in advance