Kodi Community Forum

Full Version: Problem with custom "onklick" conditional. (Title chanched)
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Would be gr8 if custom "onklick" could be conditional to!

this way it would be possible to use it in similar ways like with Buttons. (also nice to have some consistence within such functionality.)

http://forum.kodi.tv/showthread.php?tid=...pid2136130

it is possible to do a Hack by using a hidden Button, but this would just work for remotes.



shuld this work already?. -> It didn'd work on my side! (Tested with a List -> only "oncklick" without a condition did work.) if so, just tell, and i'll remove the feature request Tag.
(2016-02-27, 17:00)Rantanplan-1 Wrote: [ -> ]Would be gr8 if custom "onklick" could be conditional to!

this way it would be possible to use it in similar ways like with Buttons. (also nice to have some consistence within such functionality.)

http://forum.kodi.tv/showthread.php?tid=...pid2136130

it is possible to do a Hack by using a hidden Button, but this would just work for remotes.


shuld this work already?. -> It didn'd work on my side! (Tested with a List -> only "oncklick" without a condition did work.) if so, just tell, and i'll remove the feature request Tag.

As far as I know it's wokring. I use conditional <onfocus> commands for the list container. But never tested <onclick> so I could be wrong.

Code:
<control id="99" type="list">
                <left>84</left>
                <top>111</top>
                <width>284</width>
                <height>942</height>
                <onup>noop</onup>
                <onup>SetProperty(Movement,1)</onup>
                <ondown>noop</ondown>
                <ondown>ClearProperty(Movement)</ondown>
                <onleft>noop</onleft>
                <onfocus>ClearProperty(ForceViewType,home)</onfocus>
                <onfocus>ClearProperty(WidgetHasFocus,Home)</onfocus>
                <onfocus condition="System.HasAlarm(waitforpreload) + StringCompare(Container(1000).CurrentItem,2)">Control.Move(1000,-1)</onfocus>
                <onfocus condition="System.HasAlarm(waitforpreload) + StringCompare(Container(1000).CurrentItem,3)">Control.Move(1000,-2)</onfocus>
                <onfocus condition="System.HasAlarm(waitforpreload) + StringCompare(Container(1000).CurrentItem,4)">Control.Move(1000,-3)</onfocus>
                <onfocus condition="System.HasAlarm(waitforpreload) + StringCompare(Container(1000).CurrentItem,5)">Control.Move(1000,-4)</onfocus>
                <onfocus condition="System.HasAlarm(waitforpreload) + StringCompare(Container(1000).CurrentItem,6)">Control.Move(1000,-5)</onfocus>
                <onfocus condition="System.HasAlarm(waitforpreload) + StringCompare(Container(1000).CurrentItem,7)">Control.Move(1000,-6)</onfocus>
                <onfocus condition="System.HasAlarm(waitforpreload) + StringCompare(Container(1000).CurrentItem,8)">Control.Move(1000,-7)</onfocus>
....
ok. it was about "onklick" not about "onfocus" but..

did test again and test this time with
Code:
condition="true"
which did work.

now i just wondering why this (below) didnt work..

Code:
<control type="list" id="1000">
...
...
condition="StringCompare(Container(1000).ListItem.Label,$ADDON[plugin.audio.soundcloud 30110])"
...
<itemlayout>
...

i did test all i can think of, did also show "Container(1000).ListItem.Label" somewhere outside of the List as Label (wich work) + try to use

Code:
condition="StringCompare(Control.GetLabel(222),$ADDON[plugin.audio.soundcloud 30110])"
where 222 is the "id" of the Label which holds "Container(1000).ListItem.Label"

did also test

Code:
<onclick condition="StringCompare(test,test)">

and different variations -> non of them did work!!

Realy out od Ideas which mistake i could made there!


this is the reason why i was highly suprised that "condition="true" " did work


Are You realy shure "oncklick" can be conditional? -> "oncklick" not "onfocus" !



i use t
Tested it with:
<onclick condition="StringCompare(Container(99).CurrentItem,1)">ActivateWindow(favourites)</onclick>
and
<onclick condition="StringCompare(Container(99).ListItem.Label,Suchen)">ActivateWindow(favourites)</onclick>

-> Works.
(2016-02-27, 19:55)sualfred Wrote: [ -> ]Tested it with:
<onclick condition="StringCompare(Container(99).CurrentItem,1)">ActivateWindow(favourites)</onclick>

This did work


(2016-02-27, 19:55)sualfred Wrote: [ -> ]<onclick condition="StringCompare(Container(99).ListItem.Label,Suchen)">ActivateWindow(favourites)</onclick>

This doesnt. ?
Did u tried the localized string or the localize info string?
O.K. guess i found the Problem.

The 2nd String holds "Neue Suche" -> which didnt work (no mather how i pass it to the "SrtingCompare" -> Control.GetLabel, Pure Text, $ADDON[], and so on)

(as soon as i compare to a label without a space in between it seems to work..)

hmm.

wondering if this is a Bug?
(2016-02-27, 20:12)Rantanplan-1 Wrote: [ -> ]wondering if this is a Bug?

Was someone able to confirm this?

or shuld i try to open a ticket right away?