HomeGenie Forum
Automation Program Plugins and Wizard Scripting => Help => Topic started by: maxflax on September 21, 2014, 11:13:10 PM
-
I am wondering how to go about in the easiest manner to update a data-ui-field in my widget from my C# script.
-
Your c# app must call Program.RaiseEvent:
http://www.homegenie.it/docs/doxy/de/d1f/class_home_genie_1_1_automation_1_1_scripting_1_1_program_helper.html#af51db91ed13809da94337aac3c1053b7 (http://www.homegenie.it/docs/doxy/de/d1f/class_home_genie_1_1_automation_1_1_scripting_1_1_program_helper.html#af51db91ed13809da94337aac3c1053b7)
Program.RaiseEvent("MyField.Name", "SomeValue", "Some Description");
the widget "Refresh" method will then be invoked automatically.
g.
-
Can't get that to work.. have this field in my widget <span data-ui-field="description">...</span> And Im trying to update that <span> from my C#.
-
Hi maxflax,
please post here both the code of the c# program and of the widget (html and json files).
You also need to instruct the widget json file about what field to update from your c# app module to the widget html UI elemets (binding/mapping).
Cheers,
g.
-
I took the route setting a property from C# which I then in the json code retrieve with HG.WebApp.Utility.GetModulePropertyByName and set to my span html tag.
Not a traditional binding but it does get the job done.