Posts: 4,225
Threads: 365
Joined: May 2005
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
Posts: 40,483
Threads: 491
Joined: Aug 2002
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
Posts: 4,225
Threads: 365
Joined: May 2005
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
Posts: 40,483
Threads: 491
Joined: Aug 2002
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
Posts: 4,225
Threads: 365
Joined: May 2005
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
Posts: 3,415
Threads: 158
Joined: Jan 2006
Admin Interface...Administer...Global Actions