more G-Labs products

Author Topic: Set Value of Module Properties from Widget  (Read 896 times)

January 28, 2016, 06:48:39 PM
Read 896 times

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi,

I'm trying to set the value of a self generated module property from a widget
Code: [Select]
           "Name": "HomeGenie.ZWaveThermoWakeUpInterval",
           "Description": "",
           "Value": "",
           "UpdateTime": "2016-01-28 13:53:36Z"

I tried several things but the Value didn't change.
Can you please give me a hint how to proceed?

Thanks Christian

February 07, 2016, 04:11:33 PM
Reply #1

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Hi,
is there no way to set Module properties from a widget?

I tried several methods without a warning during code save, but also no success in changing the values.
I can set and change them from a programm but not from a widget.

Can someone tell me how to set or change the Value of the following Module property from a widget?
Code: [Select]
           "Name": "HomeGenie.ZWaveThermoWakeUpInterval",
           "Description": "",
           "Value": "",
           "UpdateTime": "2016-01-28 13:53:36Z"
[code]
Thanks for any suggestions!

br. Christian
« Last Edit: February 07, 2016, 05:12:10 PM by emerich »

February 07, 2016, 05:52:10 PM
Reply #2

dani

  • *****
  • Information
  • Global Moderator
  • Posts: 535
An exemple with parameter saved in modules.xml file :

// Get the parameter properties
param=HG.WebApp.Utility.GetModulePropertyByName(module,"ParameterName");
// Set the parameter value
param.NeedsUpdate='true';
HG.WebApp.Utility.SetModulePropertyByName(module,param.Name,newValue);
HG.WebApp.GroupModules.UpdateModule(module);

Cheers
Dani

February 07, 2016, 07:17:59 PM
Reply #3

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73
Thanks Dani,

shame on me! I forgot to set Update and the update module call!

br. Christian

February 07, 2016, 08:18:49 PM
Reply #4

Gene

  • *****
  • Information
  • Administrator
  • Posts: 1472
  • Tangible is the future!
    • Yet Another Programmer

February 08, 2016, 07:12:12 PM
Reply #5

emerich

  • ***
  • Information
  • Full Member
  • Posts: 73