Kodi Community Forum

Full Version: runaddon onclick does not work
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
My English is very bad to forgive for expressing myself badly

I am setting the confluence widget from xml with this code
<content sortby="lastused" sortorder="descending" target="addons" type="xml" limit="20">plugin://plugin.audio.radio_de</content>

but when loading the widget with
<onclick>RunAddon($INFO[Container(ID).ListItem.Property(Addon.ID)])</onclick>
does nothing
I tested with this code
<onclick>PlayMedia($INFO[Container(ID).ListItem.FilenameAndPath])</onclick>

if it worked to reproduce but not to open the addon some idea of ​​what is my error
I'm not 100% sure what you are trying to do, are you trying to open Radio stations from the Widget? Using Auto Widgets may be helpful to you https://forum.kodi.tv/showthread.php?tid=352934
If i try to open radio from a widget written in xml
<control type="group">
                <left>190</left>
                <top>92</top>
                <visible>!Skin.HasSetting(HomepageHideWidgetRadios) + Container(9000).Hasfocus(108) </visible>
                <animation effect="fade" start="0" end="100" time="300" delay="350">Visible</animation>
                <control type="group">
                    <control type="label">
                        <description>Title label</description>
                        <left>-118</left>
                        <top>40</top>
                        <width>110</width>
                        <height>100</height>
                        <label></label>
                        <align>right</align>
                        <aligny>top</aligny>
                        <font>Regular18</font>
                        <textcolor>white</textcolor>
                        <shadowcolor>black</shadowcolor>
                        <wrapmultiline>true</wrapmultiline>
                    </control>
                    <control type="panel" id="8004">
                        <left>0</left>
                        <top>0</top>
                        <width>912</width>
                        <height>176</height>
                        <onleft>8004</onleft>
                        <onright>8004</onright>
                        <onup>600</onup>
                        <ondown>9000</ondown>
                        <scrolltime>200</scrolltime>
                        <orientation>Horizontal</orientation>
                        <include>RadiosLayout1</include>
                        <include content="radioNormal" />                                
                       <onclick>RunAddon($INFO[Container(ID).ListItem.Property(Addon.ID)])</onclick>
                    </control>
                </control>
            </control>
does $INFO[Container(ID).ListItem.Property(Addon.ID)] return anything if you use it in a label control?

also, check if there's anything in the Debug Log that might provide a clue.
Returns nothing, Debug Log, or anything, does nothing when pressed
ok, well there's you answer :-)
you're trying to use a listitem property that doesn't exist.
So how could I launch the addon from the widget using RunAddon if there is some way
well, you could hardcode the addon id.
..but what's the reason you want to override <onclick> ?
I don't want to override the <onclick>.
I think I explained badly I would like to launch the addon from onclick
adding an <onclick> tag to the container like you are doing:
<onclick>RunAddon($INFO[Container(ID).ListItem.Property(Addon.ID)])</onclick>
will override the default onclick behaviour that has been set for each listitem.

also see: https://kodi.wiki/view/Dynamic_List_Cont...ick_action
So how should I put why I think that <onclick> is not if I put this code if it works
<onclick>PlayMedia($INFO[Container(ID).ListItem.FilenameAndPath])</onclick>
well hardcoding the addon id will work
<onclick>RunAddon(plugin.audio.radio_de)</onclick>

another thing that *might* work is:
<onclick>ActivateWindow(music, $INFO[Container(ID).ListItem.Path])</onclick>
Thank you very much it is already solved
ActivateWindow(music,$INFO[Container(ID).ListItem.FilenameAndPath])