HomeGenie Forum

Automation Program Plugins and Wizard Scripting => Help => Topic started by: [email protected] on April 09, 2016, 01:33:58 AM

Title: Widget basics
Post by: [email protected] on April 09, 2016, 01:33:58 AM
How do I pass text from a automation program to a widget.. not really done much with widgets. Has anyone got any simple examples.. would like to dynamically update text from a plugin onto the widget :)

Thanks
Title: Re: Widget basics
Post by: [email protected] on April 16, 2016, 12:46:05 PM
No one?
Title: Re: Widget basics
Post by: Hoke on April 17, 2016, 08:56:50 AM
So I managed to update the status text on my widget like this:


(program code)
Program.Parameter("MyModule.Status").Value = mesg;

(widget, RenderView)
var STATUS = HG.WebApp.Utility.GetModulePropertyByName(module, 'MyModule.Status').Value;
    this.statusText.html(STATUS);

HOWEVER:

The problem I am having is that it never refreshes uinless I also have a Program.Notfy

Is there any way to force a widget to redraw on status change?
Title: Re: Widget basics
Post by: Hoke on April 17, 2016, 10:59:05 AM
Answered my own question:

   Program.RaiseEvent("Program.UiRefresh", "Data Updated", "");

 ;D
Title: Re: Widget basics
Post by: [email protected] on April 18, 2016, 12:02:37 AM
Your widget prob does what I want anyway!!
Title: Re: Widget basics
Post by: Hoke on April 18, 2016, 06:07:42 PM
It's just the default widget with the above lines added. Have mailed it to you.
Title: Re: Widget basics
Post by: [email protected] on April 18, 2016, 10:04:17 PM
Thanks Chris