# Get property values of the current component w/o name

**URL:** <https://forum.inductiveautomation.com/t/get-property-values-of-the-current-component-w-o-name/6025>\
**Category:** Ignition\
**Created:** [March 13, 2013, 8:55pm UTC](https://forum.inductiveautomation.com/t/get-property-values-of-the-current-component-w-o-name/6025 "2013-03-13T20:55:58Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bob](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bob/32/16899_2.png) [@Bob](https://forum.inductiveautomation.com/u/Bob)\
**Post date:** [March 13, 2013, 8:55pm UTC](https://forum.inductiveautomation.com/t/get-property-values-of-the-current-component-w-o-name/6025/1 "2013-03-13T20:55:58Z")

</div>

I have many MultiState buttons that I am showing or hiding dynamically which is leading me to a couple issues.

First, is there a way to get the property values of the current component without specifying the name of the component? Basically is there something that can be used in an expression that is the equivalent to {thisComponent.MyProperty}? Right now I have a way to do what I need by filling the Text property of the button from the event handler that hides/shows the button, but I am still interested if a {thisComponent.MyProperty} type expression exists.

Second, I want to bind a Custom property of the button to an indirect tag where one of the indirection references would need to be “Root Container.MultiState Button1.Text”. This is a problem because I would also like to leave the “MultiState Button1” section generic so that it could be MultiState Button2, MultiState Button3, etc, without having to pre-define it in all the buttons. Is there a better way?

Thanks -

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [March 13, 2013, 10:22pm UTC](https://forum.inductiveautomation.com/t/get-property-values-of-the-current-component-w-o-name/6025/2 "2013-03-13T22:22:09Z")

</div>

I am not sure if I totally follow what you are trying to do, but both question 1 and 2 seem to be basically the same.

If you have a component that is referencing properties of itself in the expression language all the bindings with a reference to itself will update when you rename the component.

---

<div class="post-metadata">

**Author:** ![Jonathan](https://avatars.discourse-cdn.com/v4/letter/j/aeb1de/32.png) [@Jonathan](https://forum.inductiveautomation.com/u/Jonathan)\
**Post date:** [March 14, 2013, 3:30pm UTC](https://forum.inductiveautomation.com/t/get-property-values-of-the-current-component-w-o-name/6025/3 "2013-03-14T15:30:56Z")

</div>

Also when you copy the component any of the self references will change to the new component’s name automatically when pasted.

---

<div class="post-metadata">

**Author:** ![Bob](https://sea1.discourse-cdn.com/inductiveautomation/user_avatar/forum.inductiveautomation.com/bob/32/16899_2.png) [@Bob](https://forum.inductiveautomation.com/u/Bob)\
**Post date:** [March 14, 2013, 5:54pm UTC](https://forum.inductiveautomation.com/t/get-property-values-of-the-current-component-w-o-name/6025/4 "2013-03-14T17:54:10Z")

</div>

Jonathan,

I see what you mean, and I think I could make that work by putting in the the references using “MultiState Button1” and then copying that button so that all references will later automatically say “MultiState Button2”, “MultiState Button3”, etc. Because I won’t be renaming one button, I will have many buttons.

Basically there are some properties of a MultiState Button that I want to bind to another property or custom property of the same button. It still seems it would be helpful for me to be able to just use {Text} or {Me.Text} for an expression, or indirection reference for the current button Text property rather than need to have {Root Container.MultiState Button1.Text} which is specific for that button.

Thanks!

---

<div class="post-metadata">

**Author:** ![AJBerera](https://avatars.discourse-cdn.com/v4/letter/a/9fc29f/32.png) [@AJBerera](https://forum.inductiveautomation.com/u/AJBerera)\
**Post date:** [October 1, 2013, 5:16pm UTC](https://forum.inductiveautomation.com/t/get-property-values-of-the-current-component-w-o-name/6025/5 "2013-10-01T17:16:16Z")

</div>

Bob,  
Perhaps you should consider binding the event scripts and the button appearance to some indirection so that instead of showing/hiding hundreds of buttons on a window, (which will become very cumbersome to edit later) you can have a handful of buttons and simply change what they display and do based on what the current situation calls for. For example, if you want to change all of the buttons wouldn’t it be better to change 1 and have that change propagate throughout the others, rather than having to start from scratch…

Templates could be used here… I’d tend to add custom properties to my button component so that I could control what it looks like and does in the scripts based on its buttonIDENTITY property for example which could also be dynamic. If it needs to change later, simply change the custom button component you have created and replace the few you have on screen with the new design.
