In Perspective, is there a way in an Expression binding to have a dynamic path to a property of a component on the view ?
Here's the structure that I have:
I want to apply a style to the numeric field "limit" depending on the value of the numeric field "entry". Here's my code for now:
What I want is to replace "{../Conductivity_entry.props.value}" by a dynamic path with the name of the container. I tried something like "{../}+{parent.meta.name}+{_entry.props.value}" but it's not working, and I don't find a solution.
Is that possible ?
Thanks
Thanks that should work, but I'm not able to write the right path, I tried
property("../" + {parent.meta.name} + "_entry.props.value") and some other things but it doesn't work, can you give me a clue ?
Well I tried to add a script below the Expression binding, I was able to make it work but the problem that I had is for the update. The style was updated when I refreshed the page, and I want the style to be updated when I change the values.
Not really following, if you change the style, then the style should update. Try changing the style in the designer to see it working, just type it in for now.
You'll need to show more of your work to really know what's going on.
Basically I want to change the style of a field depending of the values of this field and another field. When I tried with this script it worked, but the style was updated only when I refreshed my page, while I want the script to be updated when I enter a wrong value
Yeah it's "normal" because the value of this field is dynamic, it depends of the page I open so the expression can't find a value in the designer, but it's actually working. The problem is for the update, the style change when I refresh the page
By the way I had something similar in the past, I had an expression following by a script like this and I had the same problem, the changes that the script was supposed to apply were applied when I updated the page
Oh okay that makes sense! I understand now, thanks for that
I guess I will try to solve my initial problem with just an expression, but can you help me for a last thing ?
I'm not able to write properly the path of the property I want in the property() function.
This is the initial path : {../Conductivity_entry.props.value}
This is the path for the value of another field that is in the same container of the field I'm writing the expression. "Conductivity" is the name of the container so I'd like to make this path dynamic
I tried something like : property("../" + {parent.meta.name} + "_entry.props.value")
but it's not working, what am I doing wrong ?
If you enter the function properly the text should be blue. Maybe start smaller, create some custom props and get the property() working first. IMO that is cleaner anyways. Then use the custom props in your expressions.
Edit, I don't know when the function was released, the 8.1 docs don't state. The 8.0 docs do.
Well I know that I'm using Ignition v8 but I can't find the complete description of the version so I don't know what version of the v8 I have, where can I find it ?
I checked the gateway and the "about Ignition designer"