2020-08-21, 20:14
(2020-08-19, 22:06)drinfernoo Wrote:That would be a fantastic idea and would really simplify what I am doing(2020-08-19, 20:06)justin150 Wrote: This is a complicated question that may or may not have an easy answer - but I am so far beyond my coding ability I really badly need help!!
I have in the Silvio skin (actually a mod of it) created a new style of widget: the Autowidget panel, which has a dedicated button to refresh the widget beside the panel widget (the skin is designed for use on a tablet). That button will have assigned to it in the template.xml the refresh command RunPlugin("plugin://plugin.program.autowidget/?mode=refresh&target=YOUR_ID_HERE"). In order to do that I need to parse the relevant widget path to (a) make sure that the widget is an autowidget cycling group and (b) strip out the ID then I can create a command
<onclick>RunPlugin($VAR[Static_String]$VAR[Variable_String])</onclick> where the Static_String would be "plugin://plugin.program.autowidget/?mode=refresh&target=" and the Variable_String would be autowidget ID (or something along those lines). That way it should work no matter how many different autowidget panel widgets the relevant build has.
Has anyone got ideas and could help with the actual coding - I feel at least part of the solution might be in script.module.routing but as I said I have gone so far beyond my abilities it is embarrassing
For one thing, the path you'll actually need to use is:
syntax:RunPlugin("plugin://plugin.program.autowidget/?mode=refresh&id=YOUR_ID_HERE")
You were close, but the parameter should beid
instead oftarget
.
I think the best way to handle getting the actual ID from the widget may be for me to attach it as a List item property, probably namedautoID
. Then you could not only control visibility of the control based on whether or not that property is filled, but you could use$INFO[Container(CONTAINER_ID).List item.Property(autoID)]
to fill the needed parameter in the plugin path. I can make a small update to add that property
At least, that's how I understand it... Perhaps somebody like @jurialmunkey would confirm that my logic is sound there, but I think it should work