2-state Toggle Buttons

I have 15 different 2-state toggle buttons. Each one is linked to a separate department in our plant. I also have a submit button that runs a script that logs the information from all the buttons selected(not just the department) on the form. How can I require at least one of the 2-state toggle buttons to be selected before the employee can click the submit button and log the information into our SQL table?

Bind the enabled state of the submit button to {Root Container.2 State Toggle Button 1} && {Root Container.2 State Toggle Button 2} and so on?

So would this only require one of the 2-state buttons to be true or all of them to be true?

Ah, right. Use boolean OR || instead of AND &&, and it the enabled property will be true as long as at least one of the 2 state toggle buttons is true. Making them mutually exclusive is a little more work.

You could just use addition and check for it being greater than or equal to 2 to be enabled.
I would create a custom property on the root container called OkToSubmit of type Int and make its value something like

{Root Container.2-State Toggle.indicatorValue}+{Root Container.2-State Toggle 1.indicatorValue}+{Root Container.2-State Toggle 2.indicatorValue}

Then just set your submit button enabled binding to the property being greater than the custom property value.

{Root Container.OkToSubmit}>=2

1 Like