How to call the component's own property/parameters

Can I use self.xxx to cite the component’s own property in expression function?

for example, I placed a label on the screen, assign a new property “Type” to this label.
In the visible property of this label, I am trying to assign an expression, to display this label if the “Type = 1”.
The usual way is to find the new property in the expression, like the following:
“{Root Container.Label.TYPE}=1”
But it contains a specific component path&name in it. If I have another 20 label to add, then I have to change the expression 20 times.
If I can use “{self.TYPE}=1” or something similar, then I just need to copy/paste 20 times.

Appreciate if anyone can help on it.

Regards
Chao

No, the expression language cannot do this. Note, though, that if you copy and paste the entire component after making such a binding, the new component’s “self” bindings are updated accordingly. If you need twenty such components, make the first one perfectly functional before you duplicate it.

1 Like