Hello, I am trying to get some information (a header) on my view page to disappear based on two different values. Essentially one value turns off the header, and the other turns off the entire section. I want the header to disappear if either one of those checkboxes are pressed. I've searched the ignition forums here and couldn't find a direct answer.
Any help is appreciated!
Are you using a flex container? If so, each child should have a display bool under POSITION
where you would bind an expression. The expression will determine if the object is displayed or not. Any more details you can share?
You can reference 2 different properties in an expression binding, if that was the issue.
As @dkhayes117 said, more details about what exactly the issue is would help us understand your problem.
Right sorry, I know that I can make them disappear with the visible property or the display property but I wanted to make the item disappear if 1 or both check boxes are checked. I can break it down with more info here:
I am using a coordinate view, utilizing pipes and labels to simulate a wiring diagram. I have 3 checkboxes that can toggle certain features on and off to show more or less information for whatever the operator needs.
Particularly, there is a section of information that I want to make disappear if the operator toggles a checkbox to get rid of the entire section, or just the checkbox to toggle off the overhead labels. I am specifically looking at the overhead labels in this instance since it would turn off based on the first checkbox, and the second checkbox. I have the checkboxes made and have the rest of the items working but they're based only on one value, and the overhead boxes would be subject to change based on two different prop values.
I'm sure it's something simple I just am missing while looking at it, but I for the life of me can't figure it out. Thank you for helping!
Let's see if I got this right.
There are 3 checkboxes, let's call them a
, b
and c
.
There are 2 elements, let's call them foo
and bar
.
You want foo
to be visible if a
is true
, and bar
to be visible if either a
or b
are true.
Does that look right ?
The binding on foo.meta.visible
(or foo.position.display
) would be a property binding on a
,
but the binding for bar would be an expression binding like this:
{a} || {b}
It's a simple or
.
4 Likes
This should be an expression binding on the visible property from what I understand.
- Click on the chain link beside the visible prop
- Choose
Expression
- Reference your check boxes in a logical expression, ie
# double pipes is logical OR
{../Checkbox 1.props.selected} || {../Checkbox 2.props.selected}
@pascal.fragnoud beat me to it
I think I might have misinformed you as a mistake. I did not know the symbol for or (||) existed and am thankful I found that thanks to both of you.
So, right now I guess it needs to be more of a latching script? Not sure if that's the right word. I can give a better example of what I am needing here:
- Subtext = TRUE, Sub box = TRUE, header = ON
- Subtext = TRUE, Sub box = FALSE, header = OFF
- Subtext = FALSE, Sub box= FALSE, header = OFF
- Subtext = FALSE, Sub box= FALSE, header = OFF
I am really sorry for wasting your time once I typed this out I realized I didn't even need an OR I literally just needed an AND script for the expression. smfh
Well, hey at least I learend the or function code lol. Genuine brain fart moment.
1 Like
This should do it. (obviously you'll need to browse for the correct property paths)
{../Subtext.props.selected} && {../Subbox.props.selected}
Also, here is a link to documentation on Ignition's expression language
Expression Functions | Ignition User Manual (inductiveautomation.com)
Yup I ended up fixing it before I even posted the update once I realized what I needed haha. Thanks again for the help!
2 Likes