Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
template actions and passing a value to
#1
I have not used template actions in the past as they were something that was added after all of my configuration was completed

What I have is 10 buttons doing basically the same thing and instead of writing the same code 10 times I want to have a template action and execute it, but to do so I need to pass it a value (the only thing that is different between all the actions for the buttons.

How would I go about this. Would it be a global variable or is there a better way to do it?
Mykel Koblenz
Illawarra Smart Home
Reply
#2
Is the common action anything to do with interacting with widgets, or is it just back end field type stuff?

I don't think you can pass anything in the way of action parameters to template actions. They are more just 'run something extra in the context of the current action' type stuff. So likely you'd need to use a global variable. You could have the template action delete the variable after it runs, to keep from polluting I guess.
Dean Roddey
Explorans limites defectum
Reply
#3
yeah, just field writes.

There is a bit of logic involved and that means a small change has to be made in 10 or more places or if I use a template action, its only one change.

Global variables seem to be working OK, just wanted to make sure there was not a better way that I was not aware of.
Mykel Koblenz
Illawarra Smart Home
Reply
#4
If it's just field writes, then a global action is another option. And those do take parameters. That also makes the same logic available within events.
Dean Roddey
Explorans limites defectum
Reply
#5
Where are global actions found? Its been too long since doing IV work and I have forgotten and can't any reference to them in teh Interface Development Guide.

I'm getting old and starting to forget too much.......
Mykel Koblenz
Illawarra Smart Home
Reply
#6
Admin Interface...Administer...Global Actions
Wuench
My Home Theater/Automation Website

[THREAD=5957]BlueGlass CQC Config[/THREAD]
[THREAD=10624]Wuench's CQC Drivers[/THREAD]
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  How to copy/paste command button on template Deane Johnson 1 843 04-17-2020, 02:18 PM
Last Post: Dean Roddey
  webriva template question lleo 21 11,344 01-08-2018, 08:53 AM
Last Post: Dean Roddey
  global actions and lighting groups jkmonroe 11 7,598 06-02-2017, 08:27 PM
Last Post: Dean Roddey
  Template errors after upgrade to 4.8.3 avtexan 4 2,954 08-13-2016, 11:29 PM
Last Post: avtexan
  Template Editor Annonyances rsw686 13 6,418 05-17-2015, 05:55 PM
Last Post: Dean Roddey
  Template resizing Ron Haley 1 2,158 08-12-2014, 08:21 AM
Last Post: Dean Roddey
  Want to edit template from another PC fcwilt 18 6,063 07-01-2013, 08:23 PM
Last Post: fcwilt
  URL-based actions? IVB 24 8,374 02-28-2013, 06:58 PM
Last Post: Dean Roddey
  Passing actions? sic0048 2 1,819 12-28-2012, 01:36 PM
Last Post: Dean Roddey
  Russound CAM-Tuner Template Sacedog 7 4,334 12-27-2012, 02:48 PM
Last Post: standon

Forum Jump:


Users browsing this thread: 1 Guest(s)