How to create a checkbox using Enumeration in Mendix?

0
how to create checkbox  using simple method  add radio button using enumration but how to add check box for add more item  My requirement: Show a checkbox in the form Save the value when checked Avoid creating unnecessary records if unchecked
asked
3 answers
1

In this case I don't think an Enumeration is the correct approach.

 

I would instead look at creating a helper entity, and create objects of this entity with each value you currently have in your enumeration in an attribute. Associate this entity to your own entity. You can then use the standard ComboBox widget to select the values from the helper entity.

 

https://docs.mendix.com/appstore/widgets/combobox/

 

I hope this helps. Good luck!

answered
0

Hi,

Mapping enum values into an entity as a value attribute and adding a Boolean field such as selected, then displaying this entity in a List View with a split layout (checkbox on the left, value on the right), is a valid approach. You can fully control the business logic by using a microflow or nanoflow on the checkbox’s on-change event, handling the logic when selected is true and reverting it when false. This setup provides flexibility on the UI side and works well for “add more item” scenarios, but since a record is created for each enum value, unselected options will still exist in the database with selected = false, so this approach should be used as a conscious design choice.

Hopefully, this helps you.

 

answered
0

There are several widgets in the Marketplace that work with enum, checkbox, and (multi)select.

Have a look at:

Happy, making!

answered