holding onto listitem info
#1
Working on a list of music, in this case specifically albums if it matters.   I have several buttons that I'd like to take an actions based on the focused item.   The problem is, I lose access to the listitems when the focus changes.   I've tried capturing the listitem into a string as the list is navigated using but no success. 
xml:
<onup>Skin.SetString(foo,$INFO[ListItem.DBID])</onup>
<ondown>Skin.SetString(foo,$INFO[ListItem.DBID])</ondown>
Also tried capturing the listitem using <onunfocus> as a trigger, also without success.
xml:
<onunfocus>Skin.Setstring(foo,$INFO[ListItem.DBID])</onunfocus>

One workaround was to use a quick script that ties the action directly to a keystroke since that can be done without losing focus on the list.   But it would be better to have on screen buttons.

Any help would be appreciated.
Reply
#2
you need to put the focus back to the listitem before taking the action.
to do that, you can add multiple `<onclick>` definitions to your button. so something like this might work:

<onclick>SetFocus(id of container)</onclick>
<onclick>YourAction</onclick>
<onclick>SetFocus(id of button)</onclick>
Do not PM or e-mail Team-Kodi members directly asking for support.
Always read the Forum rules, Kodi online-manual, FAQ, Help and Search the forum before posting.
Reply
#3
Thanks. For all the times I’ve already used multiple actions for a button, I never would have thought to flip the focus back to another control.
Reply

Logout Mark Read Team Forum Stats Members Help
holding onto listitem info0