more G-Labs products

Author Topic: Widget basics  (Read 1346 times)

April 09, 2016, 01:33:58 AM
Read 1346 times

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
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

April 16, 2016, 12:46:05 PM
Reply #1

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271

April 17, 2016, 08:56:50 AM
Reply #2

Hoke

  • *
  • Information
  • Newbie
  • Posts: 10
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?

April 17, 2016, 10:59:05 AM
Reply #3

Hoke

  • *
  • Information
  • Newbie
  • Posts: 10
Answered my own question:

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

 ;D

April 18, 2016, 12:02:37 AM
Reply #4

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
Your widget prob does what I want anyway!!

April 18, 2016, 06:07:42 PM
Reply #5

Hoke

  • *
  • Information
  • Newbie
  • Posts: 10
It's just the default widget with the above lines added. Have mailed it to you.

April 18, 2016, 10:04:17 PM
Reply #6

[email protected]

  • *****
  • Information
  • Hero Member
  • Posts: 271
Thanks Chris