[RELEASE] AutoWidget - Let your widgets work for you!
(2020-08-19, 22:06)drinfernoo Wrote:
(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:

You were close, but the parameter should be id instead of target.

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 named autoID. 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 Big Grin

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 Wink

I got massively side tracked by life and have only just got back to this.  Did the sensible thing and loaded up the current development version of autowidgets.

Because I am using a mod of the silvio skin I believe the syntax I should use at least for widget 1 is $INFO[Container(8011$SKINSHORTCUTS[id]).ListItem.Property(autoID)] 

So for a button command that should mean RunPlugin("plugin://plugin.program.autowidget/?mode=refresh&id=$INFO[Container(8011$SKINSHORTCUTS[id]).ListItem.Property(autoID)] ")

Sadly this is not working - in fact even $INFO[Container(8011$SKINSHORTCUTS[id]).ListItem.Property(autoID)] returns no information.

Please can someone help me on this!!

Messages In This Thread
RE: [RELEASE] AutoWidget - Let your widgets work for you! - by justin150 - 2020-11-21, 19:02

Logout Mark Read Team Forum Stats Members Help
[RELEASE] AutoWidget - Let your widgets work for you!1
This forum uses Lukasz Tkacz MyBB addons.