Hi i am trying to create a form that has booleans and i would like to use two check boxes with the boolean. so one would be true and one would be false. is this possible? if so how would i go about this?

Solution

Hello Jay,

Hope you're doing well.

Yes, it is possible indeed and OutSystems provides widgets for that purpose, depending on the type of application that you're working on.


For Reactive Web and Mobile Applications, you may use the Radio Group widget with 2 Radio Buttons (place both Radio Buttons widgets inside the Radio Group widget).

For Traditional Web Applications, you should use several Radio Buttons. In this case, in order to define a radio button group, each Radio Button widget must be bound to the same variable and assign a different value to the variable.


Please check this documentation that shows exactly how to implement the functionality that you pretend:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Inputs/Pick_Only_One_Option_in_a_Group_of_Choices


If you don't want to do that using Radio Buttons, you can always create 2 Check Boxes and implement the logic by yourself. Basically, you need to have 2 boolean variables, each one is binded to a check box. Then, you need to use the On Change event of those check boxes. Everytime you tick one, you need to affect the variable binded to the other check box (setting its value to False). This way will allow you to have only one check box selected (or none).


Let me know if you have any further questions.


Kind regards,

Rui Barradas

Solution

Rui Barradas wrote:

Hello Jay,

Hope you're doing well.

Yes, it is possible indeed and OutSystems provides widgets for that purpose, depending on the type of application that you're working on.


For Reactive Web and Mobile Applications, you may use the Radio Group widget with 2 Radio Buttons (place both Radio Buttons widgets inside the Radio Group widget).

For Traditional Web Applications, you should use several Radio Buttons. In this case, in order to define a radio button group, each Radio Button widget must be bound to the same variable and assign a different value to the variable.


Please check this documentation that shows exactly how to implement the functionality that you pretend:

https://success.outsystems.com/Documentation/11/Developing_an_Application/Design_UI/Inputs/Pick_Only_One_Option_in_a_Group_of_Choices


If you don't want to do that using Radio Buttons, you can always create 2 Check Boxes and implement the logic by yourself. Basically, you need to have 2 boolean variables, each one is binded to a check box. Then, you need to use the On Change event of those check boxes. Everytime you tick one, you need to affect the variable binded to the other check box (setting its value to False). This way will allow you to have only one check box selected (or none).


Let me know if you have any further questions.


Kind regards,

Rui Barradas

 thanks for the help

 

No problem Jay,

Glad that I could help.


Kind regards,

Rui Barradas