Nesting Not Allowed while using Properties in a Template to turn on a Light

Hi WillMT10,
I got to where I needed to be using the below Expressions. My Lights are working well.


Thank you for your help Maybe when I get a bit more comfortable, I will use the Internal Properties on another project. It is great to add to my Ignition toolbox

Glad you got it working, but I will say it is probably worth the effort to get the indirect tag binding method working. When I offered up the tag() function I didn’t realize the performance hit it could have on the system. I am going to delete my post in the hopes of not steering others in the wrong direction.

Sounds good. I am trying to work on that at the moment. Trying to wrap my head around the hierarchy between the Template Properties and the Internal Properties.

If I have a template inside of a template, is that where you would use the Internal properties?

@pturmel’s last post above gives a good overview of the difference between them but I’ll try to clarify a bit (pturmel - please correct me if you see anything wrong).

You can use the Internal Properties for really anything you want inside the template (including linking them to an embedded template). Think of them similar to custom properties on a root container in a window. When you create a template instance inside of a window, these Internal Properties are not exposed/accessible within that window. You will only see the Template Parameters listed. So these Internal Properties, among other things, are a good way to add bindings that transform or run calculations using the values passed in through Template Parameters.

Nothing wrong, but I would emphasize that template parameters are intended to interact with the window containing the template, or the canvas/repeater containing the template. Template parameters come from “outside”. You cannot attach bindings to template parameters inside the template–only in the instance in the window. When used In the repeater or canvas, template parameters should follow the rules for that container. Template parameters are also the only direct way to expose data in the template to its container, and only in single instances. However, the assignment inside the template to do so must be scripted.

Internal properties are not visible outside, but can have internal bindings. These are suitable for intermediate calculations, like the indirect tag bindings we’ve been harping on. These internal properties can be used anywhere on the inside of the template. A nested template could bind its template parameters to the outer template’s internal properties (or anything else visible to bindings inside the template).

1 Like