Problem with custom "onklick" conditional. (Title chanched)
#1
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.
Reply
#2
(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>
....
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#3
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
Reply
#4
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.
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#5
(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. ?
Reply
#6
Did u tried the localized string or the localize info string?
Main: Lancool II Mesh  - Ryzen 9 5900x - MSI x570 Unify - Zotac RTX 3080 AMP HOLO - 32GB Trident Z Neo 3600 CL16 -  EVO 960 M.2 250GB / EVO 940 250GB / MX100 512GB /  Crucial P1 2TB / WD Blue 3D Nand 2TB 
Sound: Saxx AS30 DSP - Beyer Dynamic Custom One Pro 
TV: Nvidia Shield 2019 Pro- Adalight 114x LEDs - Sony 65XG9505 - Kodi / Emby - Yamaha RX-V683 - Heco Victa 700/101/251a + Dynavoice Magic FX-4
Server: i3 Skylake - 8GB - OMV4 - 22TB Storage
Reply
#7
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?
Reply
#8
(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?
Reply

Logout Mark Read Team Forum Stats Members Help
Problem with custom "onklick" conditional. (Title chanched)0